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