Вниз
Скачать: CL | DM;

Формат ICO   Найти похожие ветки 

 
n0name   (2005-09-05 16:33) [0]

Возникла пара вопросов в изучении ICO формата.
Никто не может подсказать полного описавния этого формата?
Например, я нигде не нашёл как определить где находитсья само изображение, вроде как после AND- и XOR- масок, но как определить их размер?


 
GLFox ©   (2005-09-05 16:37) [1]

Вообще то, структуры там выглядят довольно просто:

unit Icon;

uses Windows;

interface

type
 TIconDirEntry=record
   bWidth       : Byte;
   bHeight      : Byte;
   bColorCount  : Byte;
   bReserved    : Byte;
   wPlanes      : Word;
   wBitCount    : Word;
   dwBytesInRes : DWord;
   dwImageOffset: DWord;
 end;
 TIconFileHeader=packed record
   wReserved:Word;
   wType:Word;
   wCount:Word;
   DirEntry:TIconDirEntry;
 end;
 TIconHeader =  record
   Header:BITMAPINFOHEADER;
   Colors:RGBQUAD;
   IcXOR:Byte;
   IcAND:Byte;
 end;

implementation
end.


 
Джо ©   (2005-09-05 16:37) [2]

http://www.daubnet.com/formats/ICO.html
Подойдет?

Вообще, воспользуйся Гуглом с ключевыми словами "ICO file format". Наверняка, получишь немало ссылок.


 
MBo ©   (2005-09-05 16:48) [3]

>вроде как после AND- и XOR- масок
вместо них ;))
Эти маски и содержат само изображение


 
n0name   (2005-09-05 18:11) [4]

>>GLFox ©   (05.09.05 16:37) [1]
Это то понятно, и в МСДНе написано.
>>Джо ©   (05.09.05 16:37) [2]
Всё похоже, описывают структуру, а вместо вывода непосредственно, юзают API.
>>MBo ©   (05.09.05 16:48) [3]
Хм. И как это?
Я посмотрел исходник семпла к документу про ICO из MSDN, так там не выводиться нетолько изображение но и его маски, правда XOR совпадает с изображением.
PS: А источник этого высказывания? Есть исходник?


 
MBo ©   (2005-09-05 18:25) [5]

>Хм. И как это?
AND-маска -  черно-белый битмап, определяет прозрачные области при выводе иконки.
см. описание функции CreateIcon


 
n0name   (2005-09-05 19:32) [6]

Про AND-маску есть в MSDNe немного. Каждый бит отвечает за один пиксель. А вот про XOR=маску не понятно. Как по этой маске можно составить изображение.


 
Джо ©   (2005-09-05 19:40) [7]

After the Directory entries is the actual image data for each icon. The data is arranged as a BitMapInfoHeader, palette data, and the Color image pixel data (the XOR Mask) and the Black and White pixel data (the AND mask). In order to display an icon "transparently" the AND mask is applied to the screen using the AND operation and the XOR mask is applied using the exclusive or operation. The code accompanying this page displays both masks in Image objects, and you can see that the color image is surrounded by Black while the AND mask (monochrome black and white) is black where the color image is present and then white outside the image. Black is encoded as color zero and white as a complete set of binary ones, so when the AND mask is applied to the screen using the AND operation, where the image is black, the screen pixels are excluded (1 and 0 = 0). When the color Mask is then applied using the exclusive or operation, only those places where the screen has been excluded (made zero by the AND operation described above) will the pixels of the color XOR map be applied to the screen (an exclusive or operation, only one or the other but not both).
См., например: http://www.awitness.org/delphi_pascal_tutorial/source2/icon_file_format.html



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

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.032 c
14-1129571602
Sergey_Masloff
2005-10-17 21:53
2005.11.06
Поковырялся сегодня в исходниках Indy... мама родная


14-1129495965
LordOfRock
2005-10-17 00:52
2005.11.06
Xakep.ru


2-1128951923
Gomez
2005-10-10 17:45
2005.11.06
Удаление рисунка


3-1127461627
Маленький мук
2005-09-23 11:47
2005.11.06
Тригеры в MSSQL 2000


2-1128957890
boo
2005-10-10 19:24
2005.11.06
есть программа, в ней есть окно, в которое выводятся числа от 0




   Наверх