放大图片的代码出现错误
想用两个picturebox来实现图象放大二倍,其中名为fuzhu的picturebox是不可见的,只负责存储原始图象,名为picture1的picturebox是可见的,负责显示放大后的图象.
代码如下:
Private Sub Form_Load()
fuzhu.Width = Picture1.Width
fuzhu.Height = Picture1.Height
fuzhu.PaintPicture Picture1, 0, 0
End Sub
Private Sub Command1_Click()
Picture1.Width = 2 * fuzhu.Width
Picture1.Height = 2 * fuzhu.Height
Picture1.PaintPicture fuzhu, 0, 0, 2 * fuzhu.Width, 2 * fuzhu.Height
End Sub
我没看出来哪儿错了,为什么运行时会出现"无效图片"的错误提示呢??