Hi
Here is a very simple example. This is a stand alone example and if you want to try it out, start a new test project, put a PictureBox1 on Form1 in the Designer and Dock (full). Copy/replace all Form1 code with this code and run. The Mouse Wheel will scale up/down.
' Form1 with Docked PictureBox1
Option Strict On
Option Explicit On
Public Class Form1
Dim Gscale As Single = 1S
Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
e.Graphics.ScaleTransform(Gscale, Gscale)
With e.Graphics
Using p As New Pen(Color.Red, 4)
.DrawRectangle(p, 10, 10, 100, 50)
End Using
Using p As New Pen(Color.Blue, 2)
.DrawRectangle(p, 20, 20, 50, 100)
End Using
Using p As New SolidBrush(Color.Green)
.FillRectangle(p, 90, 40, 50, 100)
End Using
Using p As New Pen(Color.Yellow, 1)
.DrawEllipse(p, 92, 42, 46, 96)
End Using
Using p As New SolidBrush(Color.Violet)
.FillEllipse(p, 24, 80, 24, 24)
End Using
End With
End Sub
Private Sub PictureBox1_MouseWheel(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseWheel
Select Case e.Delta
Case > 0
Gscale += 0.1D
If Gscale > 5 Then Gscale = 5
Case < 0
Gscale -= 0.1D
If Gscale < 0.75 Then Gscale = 0.75
End Select
PictureBox1.Invalidate()
End Sub
End Class