Significance of the copymode parameter in the Delphi-TCanvas. copyrect Method

Source: Internet
Author: User

Technical Exchange.

First, check the possible values:

 
Cmblackness = blackness; effecstinvert = regular; cmergecopy = mergecopy; cmergepaint = mergepaint; Sequence = notsrccopy; Sequence = NOTSRCERASE; Sequence = patcopy; Sequence = sequence; cmpatpaint = patpaint; Sequence = srcand; cmsrccopy = srccopy; cmsrcerase = srcerase; cmsrcinvert = SRCINVERT; cmsrcpaint = srcpaint; cmwhiteness = whiteness;

See the results. Come on.CodeTry:

Procedure construct (Sender: tobject); var RC1, RC2: trect; begin RC1: = rect (, img1.width, img1.height); RC2: = rect (, img2.width, img2.height ); with img2.canvas do begin copymode: = cmblackness; // modify the copyrect (RC1, img1.canvas, RC2); end;

To get a table:
Source image

Copymode Effect
Blackness Fill the area of the target rectangle with black.
Whiteness Fill the target rectangular area with white
Dstinvert Invert the target rectangular Image
Mergecopy Boolean and "operations on the source rectangular image and the specified pattern
Mergepaint After the source rectangular image is reversed, a Boolean OR "operation is performed on the target rectangular image.
Notsrccopy After the source rectangular image is reversed, it is copied to the target rectangle.
NOTSRCERASE Perform Boolean OR "operations on the source and target rectangular images, and then reverse the obtained images.
Patcopy Copy the specified pattern brush to the target rectangle.
Patinvert Returns the Boolean "XOR" operation between the specified pattern brush and the target rectangular image.
Patpaint First, the source rectangular image is reversed, and a Boolean OR "operation is performed with the specified pattern brush, perform Boolean OR "srcand" operations on the source and target rectangular images "and" operations on the target rectangular images
Srccopy Copy the source rectangle image directly to the target rectangle.
Srcerase Invert the target rectangular image, and then perform Boolean and "operations on the source rectangular Image
SRCINVERT Boolean "XOR" Operation on the source and target rectangular images
Srcpaint Boolean OR "Operation on the source and target rectangular images

Good. Bye

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.