Главная страница
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.022 c
2-1209915866
223001
2008-05-04 19:44
2008.06.01
здравствуйте уважаемые мастера


15-1208621002
No_Dead
2008-04-19 20:03
2008.06.01
забавная логика:) (хакерский тест->Наполеон)


2-1210619333
Nemeziz
2008-05-12 23:08
2008.06.01
Как проверить изменялся ли файл


2-1210499183
freez
2008-05-11 13:46
2008.06.01
обьеденение баз данных


15-1207899362
IGray
2008-04-11 11:36
2008.06.01
Что с TORRY.NET ?