Use the bitblt function to load bitmap. The bitmap disappears during repainting.

Source: Internet
Author: User
Bool bitblt (HDCHdcdest,// Handle of the device description tableIntNxdest,// X coordinate in the upper left corner of the output deviceIntNydest,// Y coordinate in the upper left corner of the output deviceIntNwidth,// The width of the resource on the output deviceIntNheight,// The height of the resource on the output deviceHDCHdcsrc,// Resource device description table (Virtual Device description table)IntNxsrc,// Specify the X coordinate in the upper left corner of the ResourceIntNysrc,// Specify the Y coordinate in the upper left corner of the ResourceDWORDDwrop// Grating operation code);
We know that using the bitble () function, we need a virtual device description table.(Compatible with DC)First, write the information we want to load to the virtual device description table, and then use a certain ing mode (grating operation code) to output the information to the target output device.
The Virtual Device description table is similar to the virtual memory. It refers to the temporary storage information we have opened up in the memory. It is a memory area similar to the device description table.
Create a virtual device description table (compatible with DC ):
hdcMem = CreateCompatibleDC(hdc);
Finally, call deletedc () to release the handle. Otherwise, the bitmap cannot be displayed.
It is hard to understand why the information will not be displayed without releasing the handle. If you keep applying for memory, it will not cause memory leakage or display without information. Hope you can see it for me!
My program code

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.