DrawLine Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Draws a line on the display device.
Namespace: Microsoft.SPOT
Assembly: Microsoft.SPOT.Graphics (in Microsoft.SPOT.Graphics.dll)
Syntax
'Declaration
Public Sub DrawLine ( _
color As Color, _
thickness As Integer, _
x0 As Integer, _
y0 As Integer, _
x1 As Integer, _
y1 As Integer _
)
public void DrawLine(
Color color,
int thickness,
int x0,
int y0,
int x1,
int y1
)
public:
void DrawLine(
Color color,
int thickness,
int x0,
int y0,
int x1,
int y1
)
member DrawLine :
color:Color *
thickness:int *
x0:int *
y0:int *
x1:int *
y1:int -> unit
public function DrawLine(
color : Color,
thickness : int,
x0 : int,
y0 : int,
x1 : int,
y1 : int
)
Parameters
- color
Type: Microsoft.SPOT.Presentation.Media. . :: . .Color
The color of the line.
- thickness
Type: System. . :: . .Int32
The thickness of the line, in pixels.
- x0
Type: System. . :: . .Int32
The x-coordinate location of the line's starting point.
- y0
Type: System. . :: . .Int32
The y-coordinate location of the line's starting point.
- x1
Type: System. . :: . .Int32
The x-coordinate location of the line's ending point.
- y1
Type: System. . :: . .Int32
The y-coordinate location of the line's ending point.
Remarks
If a bitmap is embedded as a resource, and its BitmapImageType is Bmp, then the Bitmap object is read-only, and attempts to modify it will throw an exception. You must make a copy of it using Bitmap.DrawImage, and modify the copy, as shown in the following code:
Bitmap bmpMyBitmap = Resources.GetBitmap(Resources.BitmapResources.MyBitmap);
Bitmap bmpCopy = new Bitmap(bmpMyBitmap.Width, bmpMyBitmap.Height);
// copy the bitmap
bmpCopy.DrawImage(0, 0, bmpMyBitmap, 0, 0, bmpMyBitmap.Width, bmpMyBitmap.Height);
// now you may modify the copy using any Bitmap method
bmpCopy.MakeTransparent(Microsoft.SPOT.Presentation.Media.Color.White);
The .NET Micro Framework provides the Microsoft.SPOT.Bitmap class for lower-level access, such as animation. For displaying static bitmaps and hyperlinked bitmaps, use the Image control.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.