Using StretchDIBits in CDialog::OnPaint
Posted on 1999-01-26
I have created a CDialog-derived class that contains four CStatic member variables that are simply frames into which bitmaps are to be drawn. Because the frames and bitmaps are of differing sizes, I believe I need to call StretchDIBits(...) to accomplish this task. However, since I start with only a CPaintDC, how do I get the handle to the DC for the StretchDIBits call? Also, how do I make sure of getting the correct coordinates for the frame rectangles and the bitmap rectangles (I'm calling LoadBitmap(IDB_BITMAP) for each one)? Finally, can I access *lpBits and *lpBitsInfo directly from CBitmap, or do I have to take some other approach?