Graphic API, stretch
Hi All,
I have a picture, I want to it be repaint as stretch not original size.
I know how to use stretch API.
but I remember that is copy from a HDC, how to do that in my app?
Best regards,
Boki.
///////////////////////////////////////////////////////////////////////////////
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TextOut (hdc, 10, 250, psText, 9) ;
if (gpPicture)
{
// get width and height of picture
long hmWidth;
long hmHeight;
gpPicture->get_Width(&hmWidth);
gpPicture->get_Height(&hmHeight);
// convert himetric to pixels
int nWidth = MulDiv(hmWidth, GetDeviceCaps(hdc, LOGPIXELSX),
HIMETRIC_INCH);
int nHeight = MulDiv(hmHeight, GetDeviceCaps(hdc, LOGPIXELSY),
HIMETRIC_INCH);
RECT rc;
GetClientRect(hWnd, &rc);
// display picture using IPicture::Render
gpPicture->Render(hdc, 0, 0, nWidth, nHeight, 0, hmHeight, hmWidth,
-hmHeight, &rc);
}
EndPaint(hWnd, &ps);
break;
///////////////////////////////////////////////////////////////////////////////