Bitblt Usage Details

Source: Internet
Author: User
Bitblt

Function: This function performs bit_block conversion on pixels in the specified source device environment area to transmit the data to the target device environment.

Function prototype: bool bitblt (HDC hdcdest, int nxdest, int nydest, int nwidth, int nheight, HDC hdcsrc, int nxsrc, int nysrc, DWORD dwrop );

Parameters:

Hdcdest: The handle pointing to the target device environment.

Nxdest: Specifies the x-axis logical coordinate in the upper left corner of the target rectangle area.

Nydest: Specifies the coordinate of the Y axis in the upper left corner of the target rectangle.

Nwidth: Specifies the logical width of the source and target Rectangular areas.

Nheight: Specifies the logical height of the source and target Rectangular areas.

Hdcsrc: refers to the handle to the Source Device environment.

Nxsrc: Specifies the x-axis logical coordinates in the upper left corner of the source rectangle area.

Nysrc: Specifies the y-axis logical coordinate in the upper left corner of the source rectangle area.

Dwdrop: Specify the grating operation code. The Code defines the color data of the source rectangle area and how to combine the color data of the target rectangle area to complete the final color.

The following lists some common grating operation codes:

Blackness: Fill the area of the target rectangle with colors related to the index 0 of the physical palette (black for the default physical palette ).

Dstinvert: indicates that the color of the target rectangle is reversed.

Mergecopy: Use the and (and) operator of the boolean type to combine the color of the source rectangle area with the specific pattern.

Mergepaint: uses the Boolean OR (OR) operator to combine the color of the Reverse source rectangle area with the color of the target rectangle area.

Notsrccopy: returns the color of the source rectangle and copies it to the target rectangle.

NOTSRCERASE: Use the Boolean OR (OR) operator to combine the color values of the source and target rectangle areas, and then reverse the merged color.

Patcopy: copy a specific pattern to the target map.

Patpaint: Use the Boolean OR (OR) operator to combine the color value after the inverse of the source rectangle area with the color of the specific pattern. Then, use the OR (OR) operator to merge the result of this operation with the color in the area of the target rectangle.

Patinvert: uses the XOR (exclusive or) operator to merge colors in the source and target Rectangular areas.

Srcand: uses the and (and) operator to merge colors in the source and target rectangle areas.

Srccopy: copy the source rectangle area directly to the target rectangle area.

Srcerase: Use the and (and) operator to reverse the color of the target rectangle area and combine it with the color value of the source rectangle area.

SRCINVERT: uses the Boolean XOR (exclusive or) operator to merge the colors of the source and target Rectangular areas.

Srcpaint: merges the colors of the source and target Rectangular areas by using the Boolean OR (OR) operator.

Whiteness: Fill the target rectangular area with colors related to index 1 in the physical palette. (This color is white for the default physical palette ).

Return Value: If the function succeeds, the return value is non-zero. If the function fails, the return value is zero.

Windows NT: To obtain more error information, call the getlasterror function.

NOTE: If rotation or shear transformation can be performed in the source device environment, bitblt returns an error. If there are other transformations (and the matching transformations in the target device environment are invalid), the rectangular area in the target device environment will be stretched, compressed, or rotated as needed.

If the color format of the source and target device environments does not match, the bitblt function converts the color format of the source scenario to a format that matches the target format. When an enhanced primitive file is being recorded, an error occurs if the source device environment is identified as an enhanced primitive file device environment. If the source and target device environments represent different devices, the bitblt function returns an error.

Windows CE: in Windows CE 1.0, the dwdrop parameter can only be specified as the following values: srccopy, srcand, srcpaint, and SRCINVERT. In Windows CE 2.0, the dwrop parameter can be any grating operation code value.

Quick query: Windows NT: 3.1 and later; windows: 95 and later; Windows CE: 1.0 and later; header file: wingdi. h; library file: gdi32.lib.

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.