Dim pbx1 As WinForm.PictureBox = Forms("窗口1").Controls("PictureBox1")
Dim pbx2 As WinForm.PictureBox = Forms("窗口1").Controls("PictureBox2")
Dim img = pbx1.image
Dim bl1 As Double = img.width / pbx1.width
Dim Top As Double = (pbx1.height - img.height / bl1) / 2
Dim bmp As new bitmap(cint(kxs*bl1), cint(gxs*bl1))
Dim g = graphics.fromimage(bmp)
Dim x As Integer = xzzb*bl1
Dim y As Integer = (yzzb-Top)*bl1
Dim w As Integer = bmp.width
Dim h As Integer = bmp.height
g.DrawImage(img, new Rectangle(0, 0, w, h), new Rectangle(x, y, w, h), GraphicsUnit.Pixel)
pbx2.image = bmp
bmp.save(ProjectPath & "B\" & Tables("照片").Current("原图"))