Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help! How can I draw a bitmap only with BITMAP information!

0 views
Skip to first unread message

xqggz

unread,
Jun 19, 2007, 8:25:35 PM6/19/07
to
HI everyone,
Now I have only the information of the BITMAP , but not an actual
bitmap. I want to draw the bitmap according the BITMAP struction
information, what can I do? I use the VC2005 Express and I am not
familliar with the SDK function? So far, I wrote a piece of code as
following , but it did work. Anyone can help me ? Thank you!

typedef struct {
FlashDisplay fd;
HWND hwnd;
PBITMAP bmp; // Graphic buffer I want to draw to the screen
} MgContext;

MgContext xc1, *xc=&xc1;
// ...............................
void FlashCopyMg(void)
{

HBITMAP hbmNew;
HDC hdc = GetDC(xc->hwnd);
HDC memDC = CreateCompatibleDC ( hdc );

hbmNew = CreateBitmap( xc->bmp->bmWidth, xc->bmp->bmHeight,
xc->bmp->bmPlanes,xc->bmp->bmBitsPixel,
xc->bmp-
>bmBits);
SelectObject(memDC, hbmNew);

BitBlt(hdc, 0, 0, xc->bmp->bmWidth, xc->bmp->bmHeight,
memDC,
0, 0, BLACKNESS);

//DeleteDC(memDC);
ReleaseDC( xc->hwnd,hdc);
}

0 new messages