vb图片处理问题
生成缩略图并保存
Set Picture3.Picture = LoadPicture(picDirFull)
Picture3.Width = 6000
Picture3.PaintPicture Picture3.Picture, 0, 0
SavePicture Picture3.Image, "c:\temp.bmp"
这样修改图片大小,结果将图片剪裁掉了,怎么样才能按照像素来生成缩略图?比如一个图片宽度X,让它生成为指定宽度为600px的缩略图
生成缩略图必然会使颜色信息丢失,方法很多,一会给你上代码
Private Sub Form_Load()
Dim pic As StdPicture
Me.Picture3.ScaleMode = vbPixels
Me.Picture3.AutoRedraw = True
Set pic = LoadPicture(picDirFull)
Me.Picture3.Width = 6000
Me.Picture3.PaintPicture pic, 0, 0, Me.Picture3.ScaleWidth, Me.Picture3.ScaleHeight
SavePicture Me.Picture3.Image, "d:\3.bmp"
End Sub
帅啊,vbPixels,这个说是像素,出来好像比绘图工具里的像素小哇 帅什么了?他把图放大了,缩小的时候仍然是剪裁
补充:VB , 多媒体