Creates a WinG device context with the stock 1x1 monochrome bitmap selected.
HDC WinGCreateDC(void)
Return Value
Returns the handle to a new WinGDC if successful. Otherwise, WinGCreateDC returns 0.
Comments
Device contexts created using WinGCreateDC must be deleted using the DeleteDC function. All objects selected into the WinGDC after it was created should be selected out and replaced with the original objects before the device context is deleted.
When a WinGDC is created, WinG automatically selects the stock 1x1 monochrome bitmap as its drawing surface. To begin drawing on the WinGDC, select a WinGBitmap created by the WinGCreateBitmap function into the WinGDC.
Maximizing Performance
WinGCreateDC has a fairly high overhead and is usually used to create a single off-screen DC. In general, programs will call WinGCreateDC once at startup then select new WinGBitmaps on WM_SIZE messages to the double-buffered window. Applications can use the WM_GETMINMAXINFO message to restrict the size of their window if necessary.
Compose frames into WinGDCs, then use WinGStretchBlt or WinGBitBlt to copy the WinGDC to the screen.
Example
See the WinGCreateBitmap API for sample code that uses WinGCreateDC.
See Also
WinGCreateBitmap CreateDC DeleteDC WM_SIZE WM_GETMINMAXINFO WinGStretchBlt WinGBitBlt CreateDIBSection Off-screen Drawing With WinG Maximizing Performance With WinG Code Samples