Private Sub Command1_Click()
Dim file_name As String
' Resize the picture.
Picture2.AutoRedraw = True
Picture2.PaintPicture Picture1.Picture, _
Picture2.ScaleLeft, Picture2.ScaleTop, _
Picture2.ScaleWidth, Picture2.ScaleHeight, _
Picture1.ScaleLeft, Picture1.ScaleTop, _
Picture1.ScaleWidth, Picture1.ScaleHeight
Picture2.Picture = Picture2.Image
' Save the result.
file_name = App.Path
If Right$(file_name, 1) <> "\" Then file_name = _
file_name & "\"
SavePicture Picture2.Picture, file_name & "small.bmp"
End Sub
Private Sub Form_Load()
Dim edge As Single
edge = Picture1.Width - Picture1.ScaleWidth
Picture2.Width = (Picture1.Width - edge) / 2 + edge
Picture2.Height = (Picture1.Height - edge) / 2 + edge
Me.Width = Picture2.Left + Picture2.Width + 240
End Sub
|