VB中图片缩小放大的程序问题

来源:百度知道 编辑:UC知道 时间:2024/06/04 03:02:11
Private Sub Command1_Click()
Image1.Width = Image1.Width * 1.5
Image1.Height = Image1.Height * 1.5
End Sub

Private Sub Command2_Click()
Image1.Width = Image1.Width / 1.5
Image1.Height = Image1.Height / 1.5
End Sub
这是一个图片扩大缩小所用到的编辑语言,但是;具体意思是什么?为什么Image1.Width = Image1.Width * 1.5
Image1.Height = Image1.Height * 1.5
其中,等号是什么意思?为什么要用等号连接?还有;这个程序的大概意思是指它能扩大1.5倍;但是,我需要的是它的相信解释
还有Image1.Width应该怎么理解?对于这个Image1.Width = Image1.Width * 1.5
等式,我要详细的解释

Image1.Width = Image1.Width * 1.5
意思是

设置Image1的宽为Image1的宽(原来宽)*1.5
OK?

全写是
Let Image1.Width = Image1.Width * 1.5

就像
a=a+1代表a的值加1(a的值为 原来a的值+1)
a=1代表a的值为1

Image1.Width = Image1.Width * 1.5
后面一个Image1.Width 是图片的原宽,
前面一个Image1.Width是代表图片现在在宽度,
用等号将 Image1.Width* 1.5(即原宽的1.5倍)赋值给现宽
后面的Image1.Height 是一样的道理