Common
Graphics Objects
The graphics
objects are the objects, which you use to
draw your GDI+ items such as images,
lines,
rectangles, and path. For
example, to fill a
rectangle with a color, you need a color
object and type of style you want to fill
such as solid, texture and so on.
There are four
common GDI+
objects, which you'll be using
throughout your GDI+ life to fill
GDI+
items. The major objects are:
Brush |
Used
to fill enclosed surfaces with
patterns, colors, or bitmaps. |
Pen |
Used
to draw lines and polygons,
including rectangles, arcs, and pies |
Font |
Used
to describe the font to be used to
render text |
Color |
Used
to describe the color used to render
a particular object. In
GDI+ color
can be alpha blended |
In
GDI+, each
of these object is represented by a class
(also called type).
The Pen Class
A pen draws a
line of specified width and style. You
always use Pen constructor to create a pen.
The constructor initializes a new instance
of the Pen class. You can
initialize it with a
color or
brush.
Initializes a
new instance of the
Pen class with the
specified color.
Public Sub New(Color)
Initializes a
new instance of the Pen class with the
specified Brush.
Public Sub New(Brush)
Initializes a
new instance of the Pen
class with the specified Brush and width.
Public Sub New(Brush, Single)
Initializes a
new instance of the Pen
class with the
Dim pn as Pen = new Pen( Color.Blue )
or
Dim pn as Pen = new Pen( Color.Blue, 100 )
specified
Color
and Width.
Public Sub New(Color, Single)
Here is one
example:
Some of its
most commonly used properties are:
Alignment
|
Gets or
sets the alignment for objects drawn
with this Pen. |
Brush |
Gets or
sets the Brush that determines
attributes of this Pen. |
Color |
Gets or
sets the color of this Pen. |
Width |
Gets or
sets the width of this Pen. |
The
Color
Structure
A
Color
structure represents an
ARGB color. Here are
ARGB properties of it:
A |
Gets the
alpha component value for this
Color. |
B |
Gets the
blue component value for this
Color. |
G |
|