最简单的办法是除法取像素。For NewX=0 To NewWidth For NewY=0 To NewHeight OldX=(NewX*OldWidth)\NewWidth OldY=(NewY*OldHeight)\NewHeight NewPixel(NewX,NewY)=OldPixel(OldX,OldY) Next Next
Option ExplicitPrivate Sub Form_Load() zoompic (0.5) End SubPrivate Sub zoompic(rate As Single) Dim dwidth As Single Dim dheight As SinglePicture2.Cls dwidth = Picture1.Width * rate dheight = Picture1.Height * rate Picture2.PaintPicture Picture1.Picture, 0, 0, dwidth, dheight End Sub
Option ExplicitPrivate Sub Form_Load() zoompic (0.5) End SubPrivate Sub zoompic(rate As Single) Dim dwidth As Single Dim dheight As SinglePicture2.Cls dwidth = Picture1.Width * rate dheight = Picture1.Height * rate Picture2.PaintPicture Picture1.Picture, 0, 0, dwidth, dheight End Sub
To Apple200228(Apple): 为什么要删我请教问题的帖子? To 大家: 大家提供的方法我都试了,但是在将3264*2448的图片压缩到1027*768时,明显失真。
丢了地址~
kodak 图像编辑控件 ImgEdit.ocx
kodak 图像管理控件 ImgAdmin.ocx
kodak 图像扫描控件 ImgScan.ocxkodak
图像缩略图控件 ImgThumb.ocx '看看这个
For NewY=0 To NewHeight
OldX=(NewX*OldWidth)\NewWidth
OldY=(NewY*OldHeight)\NewHeight
NewPixel(NewX,NewY)=OldPixel(OldX,OldY)
Next
Next
zoompic (0.5)
End SubPrivate Sub zoompic(rate As Single)
Dim dwidth As Single
Dim dheight As SinglePicture2.Cls
dwidth = Picture1.Width * rate
dheight = Picture1.Height * rate
Picture2.PaintPicture Picture1.Picture, 0, 0, dwidth, dheight
End Sub
zoompic (0.5)
End SubPrivate Sub zoompic(rate As Single)
Dim dwidth As Single
Dim dheight As SinglePicture2.Cls
dwidth = Picture1.Width * rate
dheight = Picture1.Height * rate
Picture2.PaintPicture Picture1.Picture, 0, 0, dwidth, dheight
End Sub
为什么要删我请教问题的帖子?
To 大家:
大家提供的方法我都试了,但是在将3264*2448的图片压缩到1027*768时,明显失真。