Clearing graphics?

mcerk

Well-known member
Joined
Nov 1, 2004
Messages
78
Hi.
Im drawing on picturebox with backgroudn image.
How can I clear graphics?

I want that Background image is still shown.

Code:
        Dim G As Graphics = Me.picMap.CreateGraphics()

        coordinate sistem
        Dim TranslateDx As Long = -375050
        Dim TranslateDy As Long = -194050
        Dim ScaleDx As Single = Me.picMap.Width / (624250 - 375050)
        Dim ScaleDy As Single = Me.picMap.Height / (29850 - 194050)

        G.TranslateTransform(TranslateDx, TranslateDy, MatrixOrder.Append)
        G.ScaleTransform(ScaleDx, ScaleDy, MatrixOrder.Append)
        

here I want to clear graphics to draw new line


        draw line
        PenStojisce.EndCap = LineCap.Triangle
        G.DrawLine(PenStojisce, Me.BindingContext(ds.Tables(0)).Current("X1"), Me.BindingContext(ds.Tables(0)).Current("Y1"), Me.BindingContext(ds.Tables(0)).Current("X2"), Me.BindingContext(ds.Tables(0)).Current("Y2"))
 
Back
Top