Setting Container Metrics

Start with the project you created in Implementing the Container - Initializing, Creating and Freeing.

  1. Add the following code to the WndProc function before the InvalidateRect function in the "case IDM_FILE_OPEN:" statement:

    { // CONTAINER METRICS 
       CONTAINERMETRICS Metrics; 
       Metrics.nSize = sizeof(CONTAINERMETRICS); 
       Metrics.dwMask = CMF_LIMITS | CMF_PALETTE; 
       Metrics.hPalette = hPalette; 
       SetRect(&Metrics.rcLimits, 0, 0, BITMAPWIDTH(&hBitmap), BITMAPHEIGHT(&hBitmap)); 
       L_ContainerSetMetrics(pContainer, &Metrics); 
    } // CONTAINER METRICS 

  2. Compile and run the project by selecting Build->Rebuild Solution from the menu, and then Debug->Start Without Debugging.

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Container and Automation C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.