Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2005.11.06;
Скачать: [xml.tar.bz2];

Вниз

Формат 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 вся ветка

Форум: "WinAPI";
Текущий архив: 2005.11.06;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.034 c
2-1129462287
STEEL
2005-10-16 15:31
2005.11.06
Перевод курсора на новую строку


14-1129639182
vecna
2005-10-18 16:39
2005.11.06
может кто-нить сталкивался и лечил такой косяк:


2-1128311386
Queer
2005-10-03 07:49
2005.11.06
mpeg2


2-1128595845
norwikh
2005-10-06 14:50
2005.11.06
В Win98 проекты ведут себя весьма странно


1-1129546319
integery
2005-10-17 14:51
2005.11.06
как узнать чем запущен ActiveX cscript.exe или wscript.exe





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский