Как отобразить ресурсный Bitmap?
Помогите плз. MFC не подходит, только WinAPI
В файле ресурсов лежит Bitmap - некое изображение на белом фоне. Как отобразить его в окне, так, чтобы фон был прозрачным. т. е. на синем окне рисунок был бы на синем фоне, на зеленом окне - на зеленом и т.д.
Помогите плз. MFC не подходит, только WinAPI
Ответ уже дан на http://forum.codenet.ru/showthread.php?s=&threadid=20241
Следует использовать
BOOL TransparentBlt(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of destination upper-left corner
int nYOriginDest, // y-coord of destination upper-left corner
int nWidthDest, // width of destination rectangle
int hHeightDest, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of source upper-left corner
int nYOriginSrc, // y-coord of source upper-left corner
int nWidthSrc, // width of source rectangle
int nHeightSrc, // height of source rectangle
UINT crTransparent // color to make transparent
);
UINT crTransparent // color to make transparent
);
А как в переменой UINT указать фвет. Ф-я RGB пойдет?
А как в переменой UINT указать фвет. Ф-я RGB пойдет?
Да, как раз она и нужна. И, ребят, поставьте вы себе MSDN.
Да, как раз она и нужна. И, ребят, поставьте вы себе MSDN.
Хрен с ним с UINT-ом. TransparentBlt не линкуется ни Борландом, ни Майкрософт С-плюс плюсом.. а вот это уже плохо
TransparentBlt не линкуется ни Борландом, ни Майкрософт С-плюс плюсом.. а вот это уже плохо
Хм, можно было бы и поискать:
Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Msimg32.lib.