![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
из hicon в hbitmap [D7, WinME]
stainer © (2003-10-05 01:45:00)
Привет знатоки!
Не могу найти api функцию которая делает из hicon в hbitmap!
Спасибо
andre (2003-10-05 02:35:00) [1]
По-моему такой функции нет, я делал так:
var
BM : BitMap;
ii : TIconInfo;
srcDC, destDC : HDC;
_BitMap : HBitMap;
begin
PictureBM := LoadImage (0, openfile, Image_Icon, 0, 0, LR_LOADFROMFILE or LR_CREATEDIBSECTION);
if PictureBM <> 0 then
begin
GetIconInfo (PictureBM, ii);
PicWidth := ii.xHotspot * 2;
PicHeight := ii.yHotspot * 2;
srcDC := CreateCompatibleDC (0);
destDC := CreateCompatibleDC (0);
_BitMap := SelectObject (destDC, ii.hbmColor);
_BitMap := SelectObject (srcDC, ii.hbmMask);
BitBlt (destDC, 0, 0, PicWidth, PicHeight, srcDC, 0, 0, SRCPAINT);
PictureBM := SelectObject (destDC, _BitMap);
DeleteDC (srcDC);
DeleteDC (destDC);
DeleteObject (_BitMap);
end