Tutorial by Examples

There are three ways to create a graphics object From the Paint Event Every time the control is redrawn (resized, refreshed...) this event is called, use this way if you want the control to consistently draw on the control 'this will work on any object's paint event, not just the form ...
To start drawing a shape you need to define a pen object The Pen accepts two parameters: Pen Color or Brush Pen Width The Pen Object is used to create an outline of the object you want to draw After Defining the Pen you can set specific Pen Properties Dim pens As New Pen(Color.Purple) ...
Graphics.FillShapes draws a shape and fills it in with the color given. Fill Shapes can use Brush Tool - to fill shape with a solid color Dim rect As New Rectangle(50, 50, 50, 50) e.Graphics.FillRectangle(Brushes.Green, rect) 'draws a rectangle that is filled with green e.Graphics.FillPie(...
To draw text onto the form use the DrawString Method When you draw a string you can use any of the 4 brushes listed above Dim lBrush As New LinearGradientBrush(point1, point2, Color.MediumVioletRed, Color.PaleGreen) e.Graphics.DrawString("HELLO", New Font("Impact", 60, FontSty...

Page 1 of 1