Article View: comp.os.ms-windows.programmer.misc
Article #13Need help loading Bitmap
From: John A. Slagel
Date: Tue, 27 Oct 1992 15:40
Date: Tue, 27 Oct 1992 15:40
25 lines
1624 bytes
1624 bytes
I am using MSC++ 7.00, and I read a 512x512x256 bitmap from a VIGA
frame grabber, and return two things:
HGLOBAL hBitmapBits; (This is really a BYTE FAR BitmapBits[512*512])
HGLOBAL hBitmapPalette; (This is really a RGBQUAD FAR Palette[256] )
Now, how do I display this in my ONPAINT routine?
I get the DC for the window like this:
CPaintDC dc( this );
Then, normally, you would use dc.StretchBlt to display the Bitmap.
But, this doesn't work because it needs a "CDC *pSrcDC", which I
don't have. [Q: So, where do I get it?]
So, it looks like I need to use the StretchDIBits
routine, which is normal C, but I don't have the required HDC
[QUESTION:How do I get the HDC from the CDC class?], and
I can't figure out how to put my palette values into the
BITMAPINFO structure. The struct contains RGBQUAD bmiColors[1], and
it seems I need RGBQUAD bmiColors[256]. [QUESTION: How do I do this?]
Thanks a lot for all help!
--
------------------------------------------------------------------------
John A. Slagel, email: jas37876@uxa.cso.uiuc.edu
Technical Details
Message-ID:
<BwsE7u.JCH@news.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!jas37876Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!jas37876 From: jas37876@uxa.cso.uiuc.edu (John A. Slagel) Subject: Need help loading Bitmap Message-ID: <BwsE7u.JCH@news.cso.uiuc.edu> Sender: usenet@news.cso.uiuc.edu (Net Noise owner) Organization: University of Illinois at Urbana Date: Tue, 27 Oct 1992 15:40:41 GMT Lines: 25