-
Bitmap
Ok, i am using the following code to put a bitmap.
pDC->StretchBlt(m_rcPosition.left, m_rcPosition.top,
m_rcPosition.Width(), m_rcPosition.Height(),
&dcMem, 0, 0, bmInfo.bmWidth, bmInfo.bmHeight, SRCAND);
Now what happens is the bitmaps comes on the screen in the user selected rectangle, After the user has released the LButton.
I would like that bitmap be displayed while user is selecting the region, so user can properly set the size. That is bitmap be displayed in the rubber band box.
win98 vc6
-
Well, do the stretching (StretchBlt) to the CompatibleDC, then copy the CompatibleDC with BitBlt to the DisplayDC.
Using WinAPI:
StretchBlt( hdcScaled,
0, 0,
bmInfo.bmWidth * SCALE_FACTOR_X, bmInfo.bmHeight * SCALE_FACTOR_Y,
dcSource, // a compatible DC wich contains the original image
0, 0,
bmInfo.bmWidth, bmInfo.bmHeight,
SRCCOPY );
BitBlt( hdcWin, // your display DC
0,0,
bmInfo.bmWidth, bmInfo.bmHeight,
hdcScaled,
0,0,
SRCCOPY );