我有一张图,我只想保留一部分,剪去其它部分怎么做?帮帮我真没分了。(5分)

  • 主题发起人 程序小鱼
  • 开始时间

程序小鱼

Unregistered / Unconfirmed
GUEST, unregistred user!
这样的,我有一张图,背景为白,只是在(30,30,80,80)的部分有图,而且我只想用那部分
的图,所以我要把(0,0,30,30)以及(80,80,200,200)部分剪去,只保留我想要的地方,怎
么去做呢
 
用任何一款图像处理工具,photoshop,fireworks就可以将图片裁开!
 
你如果已经能精确定位的话,可以用Canvas.CopyRect先剪切选定的图像部分。
然后用下面的语句转贴到另外一个Image上:
TempImage.Picture.SaveToClipboardFormat(。。。)//发送到剪贴板,设定句柄。
ClipBoard.SetAsHandle(。。。);

我只告诉你所用到的函数,具体格式你来搞定吧。
 
好像使用bitblt,原型如下:
BOOL BitBlt(

HDC hdcDest, // handle to destination device context
int nXDest, // x-coordinate of destination rectangle's upper-left corner
int nYDest, // y-coordinate of destination rectangle's upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source device context
int nXSrc, // x-coordinate of source rectangle's upper-left corner
int nYSrc, // y-coordinate of source rectangle's upper-left corner
DWORD dwRop // raster operation code
);
 
哦。可以么,还有没有新意见呢。
 
接受答案了.
 
顶部