Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2008.06.01;
Скачать: CL | DM;

Вниз

Иконки 256Х256, сжатые vista-форматом   Найти похожие ветки 

 
Дима_З   (2007-06-07 00:10) [0]

Каким образом с помощью средств Delphi можно получить доступ к иконке размером 256Х256 которая сжата vista-форматом (загрузить её, определить размер...).
Стандартных компонентов в Delphi (включая Delphi 2007) к сожалению для этого нет.


 
DVM ©   (2007-06-07 11:28) [1]


> которая сжата vista-форматом

что за формат такой?


 
Sapersky   (2007-06-07 13:31) [2]

Icons in current Vista builds differ in two aspects from Windows XP icons:
- Vista icons contain large high-resolution 256x256 images.
- The large images are stored using PNG compression.

Конретного описания формата не нашёл. Но судя по:

Windows Vista™ compressed icons are compatible with Windows XP. They can be used in XP but only using the standard formats (48x48, 32x32 and 16x16) which will be read and displayed. The 256x256 PNG formats will be ignored.

и

How to create 256x256 icons compatible with Windows Vista™ and Windows® XP?
Simply by creating uncompressed versions of the icons. They will work on both Operating Systems.

( http://www.axialis.com/tutorials/tutorial-vistaicons.html )

он не отличается от стандартного ICO:

 TIconHeader = packed record
   idReserved: Word; (* Always set to 0 *)
   idType: Word;     // 1 - icon, 2 - cursor
   idCount: Word;    (* Number of icon images *)
   (* immediately followed by idCount TIconDirEntries *)
 end;

 PIconDirEntry = ^TIconDirEntry;
 TIconDirEntry = packed record
   bWidth: Byte;          (* Width *)
   bHeight: Byte;         (* Height *)
   bColorCount: Byte;     (* Nr. of colors used, see below *)
   bReserved: Byte;       (* not used, 0 *)
   wPlanes: Word;   // icons - always 1, cursors - pointer X coord
   wBitCount: Word; // icons - not used, cursors - pointer Y coord
   dwBytesInRes: Longint; (* total number of bytes in images *)
   dwImageOffset: Longint;(* location of image from the beginning of file *)
 end;

Макс. допустимый размер здесь - 255 * 255. Опытным путём выяснено, что 256 * 256 кодируется как 0 * 0. Впрочем, есть ещё заголовок битмапа или PNG, в котором размер может быть какой угодно.
PNG можно записать/прочитать без проблем, благо есть поля dwImageOffset/dwBytesInRes. Как отличить от bmp - по magic number у PNG (первые 8 байт 137,80,78,71,13,10,26,10) и/или размеру, меньшему, чем должен быть у bmp.



Страницы: 1 вся ветка

Текущий архив: 2008.06.01;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.015 c
2-1209570171
Alexander
2008-04-30 19:42
2008.06.01
Компьютерные мощи


2-1209888831
Dmitry_177
2008-05-04 12:13
2008.06.01
ADO + Access


15-1208419699
tesseract
2008-04-17 12:08
2008.06.01
Чего-то Дума мутит в нашу сторону.


15-1208796208
Agent89
2008-04-21 20:43
2008.06.01
Установка компонентов


4-1188290808
DimonNew
2007-08-28 12:46
2008.06.01
События от мыши и графического планшета, разделить