Hi,
I'm building an app with a printpreview.
The printpreview prints the contents of a RichtTextbox to a PictureBox that was made the exact size of the paper used.
Now I want to be able to zoom.
I have tried the PaintPicture method using the Image of the picturebox, but I can't get it to work. Zooming in is no problem, but zooming out is.
Here is my code, just put it in a form with a commandbutton array and a picturebox.
Option Explicit
Private Sub Command1_Click(Index As Integer)
Dim vImage As IPictureDisp
Dim vZoom As Double
If Index = 0 Then
vZoom = 0.9
Else
vZoom = 1.1
End If
Set vImage = Picture1.Image
Picture1.Width = Picture1.Width * vZoom
Picture1.Height = Picture1.Height * vZoom
Picture1.PaintPicture vImage, 0, 0, vImage.Width * vZoom, vImage.Height * vZoom
Set vImage = Nothing
End Sub
Private Sub Form_Load()
Dim i As Long
For i = 1 To 50
Picture1.Print "Dit is regel " & i
Next
End Sub
Any suggestions?