GraphicsPath start point

194 Views Asked by At

Can the start point of a graphics be set?, say when i'm adding a string to a path then drawing that path the start point usually differ, so is there a way to set the start point??

also is there any way to read AI or SVG files using VB.net?

Thank you.

1

There are 1 best solutions below

0
On

I believe what you're wanting to do is apply a transformation to your Graphics object, here is an example.

Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
    e.Graphics.DrawRectangle(Pens.Red, 0, 0, 100, 100)
    e.Graphics.TranslateTransform(10.0F, 10.0F)
    e.Graphics.DrawRectangle(Pens.Red, 0, 0, 100, 100)
End Sub

Notice that once we call TranslateTransform all subsequent calls to draw operations will be offset by 10px from the top left. You can revert this transformation by calling e.Graphics.ResetTransform()