In the Window_OnCreate function, modify the WM_CREATE message processing so that the display rectangle does not fit the client area. To keep it simple, initialize the display rectangle to be the same size as the bitmap. In the WM_PAINT message processing, the L_PaintDC function uses rLeadDest as the display rectangle.
BOOL Window_OnCreate (HWND hWnd, CREATESTRUCT * lpCreateStruct)
{
L_INT nRet;
UNREFERENCED_PARAMETER (lpCreateStruct);
/* Let Window_OnPaint know to start a timer. */
bFirst = TRUE;
/* Initialize the bitmap to 24-bits. */
L_InitBitmap (&Data.BitmapHandle, sizeof(BITMAPHANDLE), Data.FileInfo.Width,
Data.FileInfo.Height, 24);
/* Load the image to the bitmap. */
nRet = L_LoadBitmap (Data.szFilename, &Data.BitmapHandle, sizeof(BITMAPHANDLE),
0, ORDER_BGR, NULL, &Data.FileInfo);
if (nRet != SUCCESS)
{
L_TCHAR buf[1024]; /* Buffer to hold the error message. */
wsprintf (buf, TEXT("Error %d Loading %s"), nRet, (LPTSTR) Data.szFilename);
MessageBox (hWnd, buf, TEXT("Error"), MB_OK);
return (FALSE); /* Failure in creation, so return FALSE. */
}
/* Set the display width and height variables to be the same as the bitmap, with proper orientation */
DisplayWidth = BITMAPWIDTH(&Data.BitmapHandle);
DisplayHeight = BITMAPHEIGHT(&Data.BitmapHandle);
/* Set the destination rectangle to use the whole bitmap */
SetRect(&rLeadDest, 0, 0, DisplayWidth, DisplayHeight);
/* Set the source rectangle to use the whole bitmap */
SetRect(&rLeadSource, 0, 0, DisplayWidth, DisplayHeight);
/* Force paint palette creation */
FORWARD_WM_QUERYNEWPALETTE (hWnd, SendMessage);
return (TRUE);
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.