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 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Container and Automation C API Help