To use the LBitmapWindow (or any derived) class as a windowed control in your application, you must create an LBitmapWindow object as a child window of some parent window, such as a dialog box, using LBitmapWindow::CreateWnd. After that, the parent window will receive control notification messages that you can process if you like.
This example was done using MFC, so your code may look different if you use some other foundation class library.
// First, you should create a button control in your dialog box (IDC_BUTTON)// Next, in your View class, declare an LBitmapWindow (or derived) class objectLBitmapWindow m_Image;// Finally, in your application's initialization code, you can add the following to use// the LBitmapWindow (or derived) object as a windowed control:// NOTE: Do not forget to load the libraries in application's initialization code:// LBase::LoadLibraries(LT_ALL_LEADLIB);CRect rcRect;COLORREF rgb;CWnd *pWnd;// Get the window for the created buttonpWnd = GetDlgItem(IDC_BUTTON);// Get the rectangle of the buttonpWnd->GetClientRect(rcRect);// Create the LBitmapWindow control, make it visible, and make it center the imagem_Image.CreateWnd(pWnd->m_hWnd, 901, WS_VISIBLE|L_BS_CENTER,rcRect.TopLeft().x, rcRect.TopLeft().y, rcRect.BottomRight().x,rcRect.BottomRight().y);// Load the filem_Image.Load(TEXT("C:\\LEADTOOLS21\\Images\\sample1.cmp"));// Get the background of the buttonrgb = GetSysColor(COLOR_BTNFACE);// Set the window background colorm_Image.SetPatternBackColor(rgb);// Fit the image in the windowm_Image.SetZoomMode(ZOOM_FIT, 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
