Win32 API: LoadBitmap n trying to BitBlt it

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Good Day!

Im confused, what im doing wrong


<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; void OnPaint(HWND hWnd, HDC hDC)
{
HINSTANCE hInstance;
hInstance = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);

<span style="color:Blue; if (!hInstance)
MessageBox(NULL, NULL, NULL, NULL);


RECT rc;
GetWindowRect(hWnd, &rc);
HDC hMemDC = CreateCompatibleDC(hDC);
HDC hBufferDC = CreateCompatibleDC(hMemDC);
HBITMAP hMemFrame = CreateBitmap(rc.right, rc.bottom, 1, 1, NULL);
HBITMAP hSplashBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_SPLASHMAIN));
HGDIOBJ hOldFrame = SelectObject(hMemDC, hMemFrame);
HGDIOBJ hOldBuffer = SelectObject(hBufferDC, hSplashBitmap);

BitBlt(hMemDC, 0, 0, 362, 100, hBufferDC, 0, 0, SRCCOPY);

TextOut(hMemDC, 10, 10, TEXT(<span style="color:#A31515; "MyText"), 6);

BitBlt(hDC, 0, 0, rc.right, rc.bottom, hMemDC, 0, 0, SRCCOPY);

SelectObject(hBufferDC, hOldBuffer);
SelectObject(hMemDC, hOldFrame);
DeleteObject(hOldBuffer);
DeleteObject(hMemFrame);
DeleteObject(hBufferDC);
DeleteObject(hMemDC);
}

[/code]
<div style="color:Black;background-color:White; <pre>
TY very much,
[/code]
<div style="color:Black;background-color:White; <pre>
Regards,
[/code]
<div style="color:Black;background-color:White; <pre>
Galym
[/code]


View the full article
 


Write your reply...
Back
Top