Foxtable(狐表)用户栏目专家坐堂 → painter


  共有2036人关注过本帖树形打印复制链接

主题:painter

帅哥哟,离线,有人找我吗?
刘林
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1936 积分:14844 威望:0 精华:0 注册:2016/4/28 9:58:00
painter  发帖心情 Post By:2020/1/18 12:01:00 [只看该作者]

Dim p As WinForm.Painter = e.Form.Controls("Painter1")
Dim img As Image = getimage("D:\test.jpg")
Dim bmpOut As new Bitmap(290, 185, PixelFormat.Format24bppRgb) '290为裁剪区域宽度,185为高度
Dim myGraphics As Graphics = Graphics.FromImage(bmpOut)
myGraphics.Clear(Color.White)
myGraphics.DrawImage(img, new Rectangle(0, 0, 290, 185), new Rectangle(270, 100, 290, 185), GraphicsUnit.Pixel) '270为原图需要裁剪的区域的左边距,100为上边距
myGraphics.Dispose()
bmpOut.Save("E:\问题\123_1.png")


老师,你好,我想不用存而是将剪切的图片在P中显示出来这怎么改,没理清关系

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105868 积分:538397 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/18 14:17:00 [只看该作者]

Dim img As Image = getimage("D:\test.jpg")
Dim bmpOut As new Bitmap(290, 185, PixelFormat.Format24bppRgb) '290为裁剪区域宽度,185为高度
Dim myGraphics As Graphics = Graphics.FromImage(bmpOut)
myGraphics.Clear(Color.White)
myGraphics.DrawImage(img, new Rectangle(0, 0, 290, 185), new Rectangle(270, 100, 290, 185), GraphicsUnit.Pixel) '270为原图需要裁剪的区域的左边距,100为上边距
Dim p As WinForm.Painter = e.Form.Controls("Painter1")
Dim
 g As Graphics = p.Graphics
g.DrawImage(
bmpOut,10,10)

 回到顶部