Createcompatibledc-[daliy APIs]

Source: Internet
Author: User

Createcompatibledc

This function creates a memory device context environment (DC) compatible with the specified device ).

Prototype:

HDC createcompatibledc (HDCHDC);

Parameters:

HDC: [in] handle of the context environment of an existing device. If this handle is null, this function createsProgramThe current display is compatible with the memory device context environment.

Return Value:

If the operation succeeds, the handle of the memory device context is returned. If the operation fails, the return value is null. To obtain more error information, call the getlasterror function.

Note:

The memory device context environment is a device context environment that only exists in the memory. When the memory device context environment is created, its display interface is a standard monochrome pixel width and a monochrome pixel height. Before an application can use the memory device context for plotting, it must select a bitmap with the correct height and width to the device context.CreatecompatiblebitmapThe function specifies a combination of height, width, and color to meet the function call needs.

When a memory device context is created, all features are set to the default value. The memory device context is used as a normal device context. Of course, you can also set these features to non-default values, obtain the current settings of its features and select a paint brush, brush, and area for it.

CreatecompatibledcThe function is only applicable to devices that support grating operations. Applications can callGetdevicecapsFunction to determine whether a device supports these operations.

This parameter can be called when the memory device context is no longer needed.DeletedcFunction to delete it.

 

Example:

// Hdcexist: handle to an existing device context
// Create DC compatible with hdcexist.
Hdccanvas = Createcompatibledc ( Hdcexist );
If ( HDC = Null )
Return ;

// Create compatible hbitmap
Hbcanvas=Createcompatiblebitmap(Hdcskin,Screenwidth,Screenheight);

// Select hbitmap into DC
SelectObject(Hdccanvas,Hbcanvas); 

 

Refer:

Interactive Encyclopedia: createcompatibledc

Msdn: createcompatibledc
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.