添加一个图片框,控件宽高比例保持两寸照比例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