vBimAgE自动调整大小
Image本来就会随图片大小而调整自己的大小.
将image的Serecth属性,设置为True.image1.height=image1.height+100image1.width=image1.width+100可以放大,把+改为-可以缩小.数值可以自己设置.
在窗体中加入一个Picture和一个Button:Private Sub Command1_Click() Picture1.Height = Me.ScaleHeight Picture1.Width = Me.ScaleWidth Picture1.AutoRedraw = True Picture1.AutoSize = True Picture1.ScaleMode = 3 Picture1.Print "先写点少的
图像的autosize设为true就ok,如代码 private sub command1_click() picture1.autosize = true end sub
用image控件来替代picturebox控件image本身会自动调整大小的,而且加载图片的方法是一样的,不妨试试
image控件有一个stretch属性,设置为True,就可以根据分辨率自动调整图片大小,picturebox控件需要代码实现
Dim image1height As Long, image1width As LongPrivate Sub Form_Load() image1height = Image1.Height image1width = Image1.Width Image1.Stretch = True HScroll1.Value = HScroll1.MaxEnd SubPrivate Sub HScroll1_Change() Image1.Height
Image中一个属性 Stretch
要用PictureBox控件实现图片缩放功能,必须自己编写代码. PictureBox控件有一个PaintPicture方法,可以对图片进行诸如缩放,复制等操作. 这个方法比较复杂,其格式为: DestPic.PaintPicture SrcPic.Picture,DestX,DestY[,DestWidth] _ [,
用image控件,设置image1的Stretch属性值为True,图像就缩放为image控件大小.