Edit: Originally this post was to draw to a transparent window... but I have found that my real problem has to do with drawing a bitmap with aplha channel info.
Could anyone point me in the right direction?
-----
I am trying to draw a graphic file to a dialog which is configured to be borderless & has nothing on it (I pretend to "draw" an image to it and frame it with a skin made of several PNG files). I have coded it so it gets layered and it's background is made transparent by means of setting it as a layered window (COLORKEY).
The dialog gets shown correctly but am I unable to "draw" the bitmap image on it... I am doing something like this during
WM_INITDIALOG:
[SIZE=2]Gdiplus::Bitmap *bitmapImage = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Gdiplus::Bitmap(szImageFileName);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (bitmapImage) [/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]
[INDENT]// Change the size of the window
[/INDENT][/COLOR][/SIZE]
[/COLOR][/SIZE]
[INDENT][SIZE=2]UINT nWidth = bitmapImage->GetWidth();[/SIZE]
[SIZE=2]UINT nHeigth = bitmapImage->GetHeight();[/SIZE]
[/INDENT][INDENT][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// Retrieve the dialog's DC[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]HDC hDC = GetWindowDC(hDlg);[/SIZE]
[SIZE=2]Gdiplus::Graphics dlgGraphics(hDC);[/SIZE]
[SIZE=2]dlgGraphics.SetInterpolationMode(InterpolationModeHighQuality);[/SIZE]
[SIZE=2]dlgGraphics.SetSmoothingMode(SmoothingModeAntiAlias);[/SIZE]
[/INDENT][INDENT][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// Configure the background color[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]Gdiplus::Color *backColor = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Gdiplus::Color();[/SIZE]
[SIZE=2]backColor->SetFromCOLORREF(GetSysColor([/SIZE][SIZE=2][SIZE=2][COLOR=black]CTLCOLOR_DLG[/COLOR][/SIZE][/SIZE][SIZE=2]));[/SIZE]
[SIZE=2]Gdiplus::SolidBrush brushBackColor(*backColor);[/SIZE]
[SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// Draw the image strip[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]dlgGraphics.FillRectangle(&brushBackColor, 35, 35, nWidth, nHeigth); [/SIZE]
[SIZE=2]dlgGraphics.DrawImage(bitmapImage, 35, 35, nWidth, nHeigth);[/SIZE]
[SIZE=2]...[/SIZE]
[/INDENT][SIZE=2]}[/SIZE]
But noting is being shown. Am I missing something?
Aqua-Soft Forums

