84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
一个非GUI(vc++)程序对图片进行处理,处理完成后获得某个区域比如(x,y,width,heigh),想保存这个区域为本地图片,该如何做?
(x,y,width,heigh)
走同样的路,发现不同的人生
The main function of IPicture is the render function, which can redraw any area of the screen. Controls, windows, etc. can be abstracted as CDC (device context), then CImage also belongs to CDC, so just draw the area on CImage.
CImage image; image.Create( weight, height, 32 );//指定image的大小参数 pPic->Render( image.GetDC(), 0, 0, weight, height, x, hmHeight - y, w, 0 - h, NULL );//参数为自己需要的区域。注意:要了解一下render图像是从左下角开始的,然后参数涉及矩阵的运算 image.Save( "D:\abc.jpg" ); image.ReleaseDC();
The main function of IPicture is the render function, which can redraw any area of the screen. Controls, windows, etc. can be abstracted as CDC (device context), then CImage also belongs to CDC, so just draw the area on CImage.