Главная страница
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.018 c
2-1209990011
TStas
2008-05-05 16:20
2008.06.01
Как бороться с сообщениями компилятора?


2-1210586371
NieL
2008-05-12 13:59
2008.06.01
функция GetAge


2-1210157112
Mishenka
2008-05-07 14:45
2008.06.01
Как вывести монитор из стендбая?


2-1210254880
WebSQLNeederr
2008-05-08 17:54
2008.06.01
Напомните как в Стринглист удалить повторяющиеся строки?


2-1210171211
operator
2008-05-07 18:40
2008.06.01
Вывод графиков контрастными цветами