Private ScaleFactor As Single
Private Sub mnuSetScale_Click(Index As Integer)
Dim i As Integer
For i = 0 To 4
mnuSetScale(i).Checked = False
Next i
mnuSetScale(Index).Checked = True
Select Case Index
Case 0
ScaleFactor = 0.25
Case 1
ScaleFactor = 0.5
Case 2
ScaleFactor = 1
Case 3
ScaleFactor = 2
Case 4
ScaleFactor = 4
End Select
' Redraw.
DrawPicture
End Sub
' Display the picture at the correct scale.
Private Sub DrawPicture()
Dim wid As Single
Dim hgt As Single
wid = HiddenPict.ScaleWidth * ScaleFactor
hgt = HiddenPict.ScaleHeight * ScaleFactor
Pict.Cls
Pict.Move 0, 0, wid, hgt
DoEvents
Pict.PaintPicture HiddenPict.Picture, _
0, 0, wid, hgt, 0, 0, _
HiddenPict.ScaleWidth, _
HiddenPict.ScaleHeight
End Sub
|