Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I use the following Paint Event to draw a vector graphics image.

 

   Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
       Dim p As New Pen(Color.Black, 1)
       e.Graphics.TranslateTransform(-hsb.Value * 10, -vsb.Value * 10)
       Dim m As New Matrix
       m.Scale(zoom, zoom)
       zoom = 1
       Dim t1 As Integer
       Dim pth As GraphicsPath
       For t1 = 0 To 0
           For Each pth In y(t1).gPaths
               pth.Transform(m)
               e.Graphics.DrawPath(p, pth)
           Next
       Next
       For t1 = 5 To 5
           For Each pth In y(t1).gPaths
               e.Graphics.DrawPath(p, pth)
           Next
       Next
   End Sub

 

This works great but I need to find the height and the width of the drawn picture to set the scroll bars min and max values.

 

Does any of you have an easy method to do this?

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...