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 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 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.