首先截取桌面图片保存成bmp文件,再读取bmp图片文件到CBitmap bmp,最后在bmp上截取图片 如 该bmp 是800 * 600 我需要(截图)截取里面一小块图片 假如 定义函数CBitmap GetImageItem(CBitmap parentImage,int x,int y,int w,int h);输入一个大图片 坐标 X 300,Y 200 , width 50 height 60
返回一个小图片块本人是新手,究竟要怎么做,请大神指教,给出现成代码更好。。不够再加分,谢谢图片截图
返回一个小图片块本人是新手,究竟要怎么做,请大神指教,给出现成代码更好。。不够再加分,谢谢图片截图
Graphics gph(pbitmap);
gph->DrawImage(...);
DrawImage就可以选择从原图哪里画多少 就画到pbitmap 里面去了
Copies a bitmap from the source device context to this current device context.然后再保存为bmp文件就可以了
CImage image;
CImage image1;
int pointX = 300;
int pointY = 200;
int width = 50;
int height = 60; image.Load(L"D:\\1.bmp");
image1.Create(width,height,image.GetBPP());
image.Draw(image1.GetDC(),0,0,width,height,pointX,pointY,width,height);
image1.Save(L"D:\\2.bmp");
~CImage()
inline HBITMAP CImage::Detach() throw()
ATLASSUME( m_hDC == NULL );
StretchBlt(只能放大)
TransparentBlt(透明)
StretchDIBits(可以缩放)这几个都可以实现裁剪