Foxtable(狐表)用户栏目专家坐堂 → 如何保持截剪框比例


  共有2416人关注过本帖平板打印复制链接

主题:如何保持截剪框比例

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


加好友 发短信
等级:超级版主 帖子:106680 积分:542589 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/11/15 21:16:00 [只看该作者]

添加一个图片框,控件宽高比例保持两寸照比例3.4:5.2。然后添加图片,运行窗口,可以使用鼠标移动图片合适的位置,再截图。可以通过按钮放大缩小图片

窗口afterlload
dim d as double = 1
vars("w")= d

放大按钮
Dim pic As WinForm.PictureBox = e.Form.Controls("PictureBox1")
pic.Image = Nothing
Dim file As String = "D:\1.png"
Dim img As image = getimage(file)
Dim w As Integer = img.width * vars("w")
vars("w") += 0.5 '放大倍数自己控制
Dim bmp As bitmap
bmp = new bitmap(img, w, w * (img.height / img.width))
pic.Image = bmp

缩小按钮
Dim pic As WinForm.PictureBox = e.Form.Controls("PictureBox1")
pic.Image = Nothing
Dim file As String = "D:\1.png"
Dim img As image = getimage(file)
Dim w As Integer = img.width * vars("w")
vars("w") -= 0.5
Dim bmp As bitmap
bmp = new bitmap(img, w, w * (img.height / img.width))
pic.Image = bmp

 回到顶部
总数 21 1 2 3 下一页