Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.24
LEADTOOLS Raster imaging C++ Class library help

Using LBitmapWindow as a Window

Show in webframe

To use the LBitmapWindow (or any derived) class as a Window in your application, you must create a window, and then assign the newly created window handle to an LBitmapWindow (or derived) object. After that, the class object will do all of the processing required to handle the Window messages that the window will receive, including those relating to displaying images. If you want to process messages yourself, you can override the LBitmapWindow::MsgProcCallBack vitrual function.

The following is a short example of getting started using LBitmapWindow as a Window. This example was done using MFC, so your code may look different if you use some other foundation class library.

 

// Do not forget to load the libraries in application's initialization code:
// LBase::LoadLibraries(LT_ALL_LEADLIB);

// In your View class, declare an LBitmapWindow (or derived) class object
LBitmapWindow m_Image;

// Now, in the function for processing WM_PAINT messages:
COLORREF rgb;
// Set the window handle
m_Image.SetWndHandle(m_hWnd);
// Load the file
m_Image.Load(TEXT("c:\\ltwin14\\images\\sample1.cmp"));
// Get the background of the window
rgb = GetSysColor(COLOR_WINDOW);
// Set the window background color
m_Image.SetPatternBackColor(rgb);
// Fit the image in the window
m_Image.SetZoomMode(ZOOM_FIT, TRUE);

Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.