MGL_endPaint

Cleans up after a previous call to MGL_beginPaint.

Declaration

void MGLAPI MGL_endPaint(
    MGLDC *dc)

Prototype In

mglwin.h

Parameters

dc

MGL windowed device context to use

 

Description

This function and its and the corresponding function MGL_beginPaint() should be called between the windows BeginPaint and EndPaint messages.

MGL_beginPaint() and MGL_endPaint() must bracket drawing functions that draw to a window type with a style of CS_PARENTDC or CS_CLASSDC. Such as dialog box controls. These types of windows allocate device handles on the fly so the HDC may change between calls to GetDC() or BeginPaint(). Therefore MGL cannot draw to these types of windows without knowing the new HDC after every BeginPaint() or GetDC() call.

A typical Windows WM_PAINT handler would be coded as follows:

case WM_PAINT:
    hdc = BeginPaint(hwnd,&ps);
    MGL_beginPaint(dc,hdc);
    // Do rasterizing code in here //
    MGL_bitBlt(dc,memDC,r,0,0,MGL_REPLACE_MODE);
    MGL_endPaint(dc);
    EndPaint(hwnd,&ps);
    return 0;

See Also

MGL_beginPaint

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com