Table of Contents

Class Bitmap

Namespace
nanoFramework.UI
Assembly
nanoFramework.Graphics.dll

Encapsulates a bitmap, which consists of the pixel data for a graphics image and its methods and attributes This class cannot be inherited.NET nanoFramework provides the Bitmap class on the native side.

public sealed class Bitmap : MarshalByRefObject, IDisposable
Inheritance
Bitmap
Implements
Inherited Members
Extension Methods

Constructors

Bitmap(byte[], BitmapImageType)

Encapsulates a bitmap, which consists of the pixel data for a graphics image and its methods and attributes.

public Bitmap(byte[] imageData, Bitmap.BitmapImageType type)

Parameters

imageData byte[]

An array of pixel data for the specified image.

type Bitmap.BitmapImageType

The bitmap type for the specified image.

Bitmap(Size)

Encapsulates a bitmap, which consists of the pixel data for a graphics image and its methods and attributes.

public Bitmap(Size size)

Parameters

size Size

The Size of the bitmap.

Bitmap(int, int)

Encapsulates a bitmap, which consists of the pixel data for a graphics image and its methods and attributes.

public Bitmap(int width, int height)

Parameters

width int

The width of the bitmap.

height int

The height of the bitmap.

Fields

CenterX

Gets the x-coordinate location of the center of the display device, in pixels.

public static readonly int CenterX

Field Value

int

CenterY

Gets the y-coordinate location of the center of the display device, in pixels.

public static readonly int CenterY

Field Value

int

MaxHeight

Gets the maximum height of the display device, in pixels.

public static readonly int MaxHeight

Field Value

int

MaxWidth

Gets the maximum width of the display device, in pixels.

public static readonly int MaxWidth

Field Value

int

OpacityOpaque

Specifies that the current bitmap is opaque.

public const ushort OpacityOpaque = 256

Field Value

ushort

OpacityTransparent

Specifies that the current bitmap is transparent.

public const ushort OpacityTransparent = 0

Field Value

ushort

Properties

Height

Gets the height of the current bitmap.

public int Height { get; }

Property Value

int

Width

Gets the width of the current bitmap.

public int Width { get; }

Property Value

int

Methods

Clear()

Clears the entire drawing surface.

public void Clear()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

DrawChar(ushort, int, int, Color, Font)

Draws a single character to the screen.

public void DrawChar(ushort c, int x, int y, Color color, Font font)

Parameters

c ushort

The character to draw.

x int

The x-coordinate of the upper-left corner to draw to.

y int

The y-coordinate of the upper-left corner to draw to.

color Color

The color to be used for the character.

font Font

The font to be used for the character.

DrawEllipse(Color, Point, int, int)

Draw an ellipse

public void DrawEllipse(Color colorOutline, Point point, int xRadius, int yRadius)

Parameters

colorOutline Color

The outline color.

point Point

The location of the center of the ellipse.

xRadius int

The radius of the ellipse in the x-coordinate direction.

yRadius int

The radius of the ellipse in the y-coordinate direction.

DrawEllipse(Color, int, Point, int, int, Color, Point, Color, Point, ushort)

Draws an ellipse filled with a specified color gradient.

public void DrawEllipse(Color colorOutline, int thicknessOutline, Point point, int xRadius, int yRadius, Color colorGradientStart, Point gradientStartPoint, Color colorGradientEnd, Point gradientEndPoint, ushort opacity = 256)

Parameters

colorOutline Color

The outline color.

thicknessOutline int

The thickness of the ellipse's outline, in pixels.

point Point

The location of the center of the ellipse.

xRadius int

The radius of the ellipse in the x-coordinate direction.

yRadius int

The radius of the ellipse in the y-coordinate direction.

colorGradientStart Color

The starting color of the color gradient.

gradientStartPoint Point

The location of the starting point of the color gradient.

colorGradientEnd Color

The ending color of the color gradient.

gradientEndPoint Point

The location of the ending point of the color gradient.

opacity ushort

The opacity of the ellipse.

DrawEllipse(Color, int, int, int, int)

Draw an ellipse

public void DrawEllipse(Color colorOutline, int x, int y, int xRadius, int yRadius)

Parameters

colorOutline Color

The outline color.

x int

The x-coordinate location of the center of the ellipse.

y int

The y-coordinate location of the center of the ellipse.

xRadius int

The radius of the ellipse in the x-coordinate direction.

yRadius int

The radius of the ellipse in the y-coordinate direction.

DrawEllipse(Color, int, int, int, int, int, Color, int, int, Color, int, int, ushort)

Draws an ellipse filled with a specified color gradient.

public void DrawEllipse(Color colorOutline, int thicknessOutline, int x, int y, int xRadius, int yRadius, Color colorGradientStart, int xGradientStart, int yGradientStart, Color colorGradientEnd, int xGradientEnd, int yGradientEnd, ushort opacity = 256)

Parameters

colorOutline Color

The outline color.

thicknessOutline int

The thickness of the ellipse's outline, in pixels.

x int

The x-coordinate location of the center of the ellipse.

y int

The y-coordinate location of the center of the ellipse.

xRadius int

The radius of the ellipse in the x-coordinate direction.

yRadius int

The radius of the ellipse in the y-coordinate direction.

colorGradientStart Color

The starting color of the color gradient.

xGradientStart int

The x-coordinate location of the starting point of the color gradient.

yGradientStart int

The y-coordinate location of the starting point of the color gradient.

colorGradientEnd Color

The ending color of the color gradient.

xGradientEnd int

The x-coordinate location of the ending point of the color gradient.

yGradientEnd int

The y-coordinate location of the ending point of the color gradient.

opacity ushort

The opacity of the ellipse.

DrawImage(Point, Bitmap, Rectangle, ushort)

Draws a rectangular block of pixels with a specified degree of transparency.

public void DrawImage(Point point, Bitmap bitmap, Rectangle rectangle, ushort opacity = 256)

Parameters

point Point

The location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.

bitmap Bitmap

The source bitmap.

rectangle Rectangle

The rectangle of pixels to be copied.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

DrawImage(Point, Bitmap, ushort)

Draws a block of pixels with a specified degree of transparency.

public void DrawImage(Point point, Bitmap bitmap, ushort opacity = 256)

Parameters

point Point

The location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.

bitmap Bitmap

The source bitmap.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

DrawImage(int, int, Bitmap, int, int, int, int, ushort)

Draws a rectangular block of pixels with a specified degree of transparency.

public void DrawImage(int xDst, int yDst, Bitmap bitmap, int xSrc, int ySrc, int width, int height, ushort opacity = 256)

Parameters

xDst int

The x-coordinate location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.

yDst int

The y-coordinate location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.

bitmap Bitmap

The source bitmap.

xSrc int

The x-coordinate location of the upper-left corner of the rectangular area in the source bitmap from which the specified pixels are to be copied.

ySrc int

The x-coordinate location of the upper-left corner of the rectangular area in the source bitmap from which the specified pixels are to be copied.

width int

The width of the rectangular block of pixels to be copied.

height int

The height of the rectangular block of pixels to be copied.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

DrawLine(Color, int, Point, Point)

Draws a line on the display device.

public void DrawLine(Color color, int thickness, Point start, Point end)

Parameters

color Color

The color of the line.

thickness int

The thickness of the line, in pixels. (Not currently available; all lines are one pixel thick.)

start Point

The location of the line's starting point.

end Point

The location of the line's ending point.

DrawLine(Color, int, int, int, int, int)

Draws a line on the display device.

public void DrawLine(Color color, int thickness, int x0, int y0, int x1, int y1)

Parameters

color Color

The color of the line.

thickness int

The thickness of the line, in pixels. (Not currently available; all lines are one pixel thick.)

x0 int

The x-coordinate of the line's starting point.

y0 int

The y-coordinate of the line's starting point.

x1 int

The x-coordinate of the line's ending point.

y1 int

The y-coordinate of the line's ending point.

DrawRectangle(Color, int, Rectangle, int, int, Color, Point, Color, Point, ushort)

Draws a rectangle on the display device.

public void DrawRectangle(Color colorOutline, int thicknessOutline, Rectangle rectangle, int xCornerRadius, int yCornerRadius, Color colorGradientStart, Point gradientStartPoint, Color colorGradientEnd, Point gradientEndPoint, ushort opacity = 256)

Parameters

colorOutline Color

The color of the rectangle's outline.

thicknessOutline int

The thickness of the rectangle's outline, in pixels.

rectangle Rectangle

The rectangle to draw.

xCornerRadius int

The x-coordinate value of the corner radius used to produce rounded corners on the rectangle.

yCornerRadius int

The y-coordinate value of the corner radius used to produce rounded corners on the rectangle.

colorGradientStart Color

The starting color for a color gradient.

gradientStartPoint Point

The location of the starting point of the color gradient.

colorGradientEnd Color

Specifies the ending color of the color gradient.

gradientEndPoint Point

The location of the ending point of the color gradient.

opacity ushort

Specifies the opacity of the fill color. Set to 0x00 for completely transparent. Set to 0xFF for completely opaque.

DrawRectangle(Color, int, int, int, int, int, int, int, Color, int, int, Color, int, int, ushort)

Draws a rectangle on the display device.

public void DrawRectangle(Color colorOutline, int thicknessOutline, int x, int y, int width, int height, int xCornerRadius, int yCornerRadius, Color colorGradientStart, int xGradientStart, int yGradientStart, Color colorGradientEnd, int xGradientEnd, int yGradientEnd, ushort opacity = 256)

Parameters

colorOutline Color

The color of the rectangle's outline.

thicknessOutline int

The thickness of the rectangle's outline, in pixels.

x int

The x-coordinate of the rectangle's upper-left corner.

y int

The y-coordinate of the rectangle's upper-left corner.

width int

The width of the rectangle, in pixels.

height int

The height of the rectangle, in pixels.

xCornerRadius int

The x-coordinate value of the corner radius used to produce rounded corners on the rectangle.

yCornerRadius int

The y-coordinate value of the corner radius used to produce rounded corners on the rectangle.

colorGradientStart Color

The starting color for a color gradient.

xGradientStart int

The x-coordinate location of the starting point of the color gradient.

yGradientStart int

The y-coordinate location of the starting point of the color gradient.

colorGradientEnd Color

The ending color of the color gradient.

xGradientEnd int

The x-coordinate location of the ending point of the color gradient.

yGradientEnd int

The y-coordinate location of the ending point of the color gradient.

opacity ushort

Specifies the opacity of the fill color. Set to 0x00 for completely transparent. Set to 0xFF for completely opaque.

DrawRectangle(Rectangle, int, Color)

Draws a rectangle outline on the display device.

public void DrawRectangle(Rectangle rectangle, int thickness, Color color)

Parameters

rectangle Rectangle

The rectangle to draw.

thickness int

The thickness of the rectangle's outline, in pixels.

color Color

The color of the rectangle's outline.

DrawRectangle(int, int, int, int, int, Color)

Draws a rectangle outline on the display device.

public void DrawRectangle(int x, int y, int width, int height, int thickness, Color color)

Parameters

x int

The x-coordinate of the rectangle's upper-left corner.

y int

The y-coordinate of the rectangle's upper-left corner.

width int

The width of the rectangle, in pixels.

height int

The height of the rectangle, in pixels.

thickness int

The thickness of the rectangle's outline, in pixels.

color Color

The color of the rectangle's outline.

DrawRoundRectangle(Rectangle, int, int, Color)

Draw a rounded rectangle outline on the display device.

public void DrawRoundRectangle(Rectangle rectangle, int thickness, int cornerRadius, Color color)

Parameters

rectangle Rectangle

The rectangle to draw.

thickness int

The thickness of the rectangle's outline, in pixels.

cornerRadius int

The corner radius used to produce rounded corners on the rectangle.

color Color

The color of the rectangle's outline.

DrawRoundRectangle(Rectangle, int, int, int, Color)

Draw a rounded rectangle outline on the display device.

public void DrawRoundRectangle(Rectangle rectangle, int thickness, int xCornerRadius, int yCornerRadius, Color color)

Parameters

rectangle Rectangle

The rectangle to draw.

thickness int

The thickness of the rectangle's outline, in pixels.

xCornerRadius int

The x-coordinate value of the corner radius used to produce rounded corners on the rectangle.

yCornerRadius int

The y-coordinate value of the corner radius used to produce rounded corners on the rectangle.

color Color

The color of the rectangle's outline.

DrawRoundRectangle(int, int, int, int, int, int, int, Color)

Draw a rounded rectangle outline on the display device.

public void DrawRoundRectangle(int x, int y, int width, int height, int thickness, int xCornerRadius, int yCornerRadius, Color color)

Parameters

x int

The x-coordinate of the rectangle's upper-left corner.

y int

The y-coordinate of the rectangle's upper-left corner.

width int

The width of the rectangle, in pixels.

height int

The height of the rectangle, in pixels.

thickness int

The thickness of the rectangle's outline, in pixels.

xCornerRadius int

The x-coordinate value of the corner radius used to produce rounded corners on the rectangle.

yCornerRadius int

The y-coordinate value of the corner radius used to produce rounded corners on the rectangle.

color Color

The color of the rectangle's outline.

DrawText(string, Font, Color, Point)

Draws text on the display device using a specified font and color.

public void DrawText(string text, Font font, Color color, Point point)

Parameters

text string

The text to be drawn.

font Font

The font to be used for the text.

color Color

The color to be used for the text.

point Point

The location where the text drawing is to begin.

DrawText(string, Font, Color, int, int)

Draws text on the display device using a specified font and color.

public void DrawText(string text, Font font, Color color, int x, int y)

Parameters

text string

The text to be drawn.

font Font

The font to be used for the text.

color Color

The color to be used for the text.

x int

The x-coordinate of the location where the text drawing is to begin.

y int

The y-coordinate of the location where the text drawing is to begin.

DrawTextInRect(string, Rectangle, uint, Color, Font)

Draws text in a specified rectangle.

public void DrawTextInRect(string text, Rectangle rectangle, uint dtFlags, Color color, Font font)

Parameters

text string
rectangle Rectangle
dtFlags uint
color Color
font Font

DrawTextInRect(string, int, int, int, int, uint, Color, Font)

Draws text in a specified rectangle. Sets the clipping region (clipping rectangle) of a bitmap with a specified coordinate pair (x, y), width, and height.

public void DrawTextInRect(string text, int x, int y, int width, int height, uint dtFlags, Color color, Font font)

Parameters

text string

The text to be drawn. This parameter contains the remaining text, or an empty string, if the complete text string did not fit in the specified rectangle.

x int

The x-coordinate of the upper-left corner of the rectangle.

y int

The y-coordinate of the upper-left corner of the rectangle.

width int

The width of the rectangle.

height int

The height of the rectangle.

dtFlags uint

Flags that specify the format of the text.

color Color

The color to be used for the text.

font Font

The font to be used for the text.

DrawTextInRect(ref string, ref int, ref int, int, int, int, int, uint, Color, Font)

Draws text in a specified rectangle. Sets the clipping region (clipping rectangle) of a bitmap with a specified coordinate pair (x, y), width, and height.

public bool DrawTextInRect(ref string text, ref int xRelStart, ref int yRelStart, int x, int y, int width, int height, uint dtFlags, Color color, Font font)

Parameters

text string

The text to be drawn. This parameter contains the remaining text, or an empty string, if the complete text string did not fit in the specified rectangle.

xRelStart int

The x-coordinate, relative to the rectangle, at which text drawing is to begin.

yRelStart int

The y-coordinate, relative to the rectangle, at which text drawing is to begin.

x int

The x-coordinate of the upper-left corner of the rectangle.

y int

The y-coordinate of the upper-left corner of the rectangle.

width int

The width of the rectangle.

height int

The height of the rectangle.

dtFlags uint

Flags that specify the format of the text.

color Color

The color to be used for the text.

font Font

The font to be used for the text.

Returns

bool

Returns true if the text was completely drawn, false otherwise.

FillGradientRectangle(Rectangle, Color, Point, Color, Point, ushort)

Draws a filled rectangle with a color gradient on the display device.

public void FillGradientRectangle(Rectangle rectangle, Color colorGradientStart, Point gradientStartPoint, Color colorGradientEnd, Point gradientEndPoint, ushort opacity = 256)

Parameters

rectangle Rectangle

The rectangle to draw.

colorGradientStart Color

The starting color for the color gradient.

gradientStartPoint Point

The starting location of the color gradient.

colorGradientEnd Color

The ending color of the color gradient.

gradientEndPoint Point

The ending location of the color gradient.

opacity ushort

The opacity of the fill color, ranging from completely transparent to completely opaque.

FillGradientRectangle(int, int, int, int, Color, int, int, Color, int, int, ushort)

Draws a filled rectangle with a color gradient on the display device.

public void FillGradientRectangle(int x, int y, int width, int height, Color colorGradientStart, int xGradientStart, int yGradientStart, Color colorGradientEnd, int xGradientEnd, int yGradientEnd, ushort opacity = 256)

Parameters

x int

The x-coordinate of the rectangle's upper-left corner.

y int

The y-coordinate of the rectangle's upper-left corner.

width int

The width of the rectangle, in pixels.

height int

The height of the rectangle, in pixels.

colorGradientStart Color

The starting color for the color gradient.

xGradientStart int

The x-coordinate of the starting location of the color gradient.

yGradientStart int

The y-coordinate of the starting location of the color gradient.

colorGradientEnd Color

The ending color of the color gradient.

xGradientEnd int

The x-coordinate of the ending location of the color gradient.

yGradientEnd int

The y-coordinate of the ending location of the color gradient.

opacity ushort

The opacity of the fill color, ranging from completely transparent to completely opaque.

FillRectangle(Rectangle, Color, ushort)

Draw a filled rectangle on the display device.

public void FillRectangle(Rectangle rectangle, Color color, ushort opacity = 256)

Parameters

rectangle Rectangle

The rectangle to draw.

color Color

The color of the rectangle's outline.

opacity ushort

Specifies the opacity of the fill color. Set to OpacityTransparent for completely transparent. Set to OpacityOpaque for completely opaque.

FillRectangle(int, int, int, int, Color, ushort)

Draw a filled rectangle on the display device.

public void FillRectangle(int x, int y, int width, int height, Color color, ushort opacity = 256)

Parameters

x int

The x-coordinate of the rectangle's upper-left corner.

y int

The y-coordinate of the rectangle's upper-left corner.

width int

The width of the rectangle, in pixels.

height int

The height of the rectangle, in pixels.

color Color

The color of the rectangle's outline.

opacity ushort

Specifies the opacity of the fill color. Set to OpacityTransparent for completely transparent. Set to OpacityOpaque for completely opaque.

FillRoundRectangle(Rectangle, int, Color, ushort)

Draw a filled rounded rectangle on the display device.

public void FillRoundRectangle(Rectangle rectangle, int cornerRadius, Color color, ushort opacity = 256)

Parameters

rectangle Rectangle

The rectangle to draw.

cornerRadius int

The corner radius used to produce rounded corners on the rectangle.

color Color

The color of the rectangle's outline.

opacity ushort

Specifies the opacity of the fill color. Set to OpacityTransparent for completely transparent. Set to OpacityOpaque for completely opaque.

FillRoundRectangle(Rectangle, int, int, Color, ushort)

Draw a filled rounded rectangle on the display device.

public void FillRoundRectangle(Rectangle rectangle, int xCornerRadius, int yCornerRadius, Color color, ushort opacity = 256)

Parameters

rectangle Rectangle

The rectangle to draw.

xCornerRadius int

The x-coordinate value of the corner radius used to produce rounded corners on the rectangle.

yCornerRadius int

The y-coordinate value of the corner radius used to produce rounded corners on the rectangle.

color Color

The color of the rectangle's outline.

opacity ushort

Specifies the opacity of the fill color. Set to OpacityTransparent for completely transparent. Set to OpacityOpaque for completely opaque.

FillRoundRectangle(int, int, int, int, int, int, Color, ushort)

Draw a filled rounded rectangle on the display device.

public void FillRoundRectangle(int x, int y, int width, int height, int xCornerRadius, int yCornerRadius, Color color, ushort opacity = 256)

Parameters

x int

The x-coordinate of the rectangle's upper-left corner.

y int

The y-coordinate of the rectangle's upper-left corner.

width int

The width of the rectangle, in pixels.

height int

The height of the rectangle, in pixels.

xCornerRadius int

The x-coordinate value of the corner radius used to produce rounded corners on the rectangle.

yCornerRadius int

The y-coordinate value of the corner radius used to produce rounded corners on the rectangle.

color Color

The color of the rectangle's outline.

opacity ushort

Specifies the opacity of the fill color. Set to OpacityTransparent for completely transparent. Set to OpacityOpaque for completely opaque.

Finalize()

Releases unmanaged resources and performs other cleanup operations before the Bitmap is reclaimed by garbage collection.

protected override void Finalize()

Flush()

Flushes the current bitmap to the display device. Bitmap will be written to the upper-left corner of the screen (full-screen, for full-screen bitmaps).

public void Flush()

Flush(Rectangle)

Flushes a sub-rectangle of the current bitmap to the display device.

public void Flush(Rectangle rectangle)

Parameters

rectangle Rectangle

Flush(Rectangle, Point)

Flushes a sub-rectangle of the current bitmap to the display device at a specified screen position.

public void Flush(Rectangle source, Point destination)

Parameters

source Rectangle
destination Point

Flush(int, int, int, int)

Flushes a sub-rectangle of the current bitmap to the display device.

public void Flush(int x, int y, int width, int height)

Parameters

x int

The x-coordinate of the sub-rectangle's upper-left corner.

y int

The y-coordinate of the sub-rectangle's upper-left corner.

width int

The width of the sub-rectangle.

height int

The height of the sub-rectangle.

Flush(int, int, int, int, int, int)

Flushes a sub-rectangle of the current bitmap to the display device at a specified screen position.

public void Flush(int srcX, int srcY, int width, int height, int screenX, int screenY)

Parameters

srcX int

The x-coordinate of the sub-rectangle's upper-left corner.

srcY int

The y-coordinate of the sub-rectangle's upper-left corner.

width int

The width of the sub-rectangle.

height int

The height of the sub-rectangle.

screenX int

The x-coordinate of the screen to write to.

screenY int

The y-coordinate of the screen to write to

GetBitmap()

Gets the bitmap of the display device.

public byte[] GetBitmap()

Returns

byte[]

A byte array representing the bitmap of the display device.

GetPixel(Point)

Retrieves the pixel color at a specified location on the display device.

public Color GetPixel(Point point)

Parameters

point Point

The location of the pixel whose color you want to get.

Returns

Color

The color of the specified pixel.

GetPixel(int, int)

Retrieves the pixel color at a specified location on the display device.

public Color GetPixel(int xPos, int yPos)

Parameters

xPos int

The x-coordinate of the pixel whose color you want to get.

yPos int

The y-coordinate of the pixel whose color you want to get.

Returns

Color

The color of the specified pixel.

MakeTransparent(Color)

Sets a bitmap's transparent color.

public void MakeTransparent(Color color)

Parameters

color Color

The color to be used as the bitmap's transparent color.

RotateImage(int, Point, Bitmap, Rectangle, ushort)

Rotates a rectangular block of pixels with a specified degree of transparency.

public void RotateImage(int angle, Point point, Bitmap bitmap, Rectangle rectangle, ushort opacity = 256)

Parameters

angle int

The degree of rotation.

point Point

The location of the center of the destination bitmap.

bitmap Bitmap

The source bitmap.

rectangle Rectangle

The rectangle of the source bitmap.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

RotateImage(int, Point, Bitmap, ushort)

Rotates a rectangular block of pixels with a specified degree of transparency.

public void RotateImage(int angle, Point point, Bitmap bitmap, ushort opacity = 256)

Parameters

angle int

The degree of rotation.

point Point

The location of the center of the destination bitmap.

bitmap Bitmap

The source bitmap.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

RotateImage(int, int, int, Bitmap, int, int, int, int, ushort)

Rotates a rectangular block of pixels with a specified degree of transparency.

public void RotateImage(int angle, int xDst, int yDst, Bitmap bitmap, int xSrc, int ySrc, int width, int height, ushort opacity = 256)

Parameters

angle int

The degree of rotation.

xDst int

The x-coordinate of the center of the destination bitmap.

yDst int

The y-coordinate of the center of the destination bitmap.

bitmap Bitmap

The source bitmap.

xSrc int

The x-coordinate of the center of the source bitmap.

ySrc int

The y-coordinate of the center of the source bitmap.

width int

The width of the rectangular block of pixels to be copied.

height int

The height of the rectangular block of pixels to be copied.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

Scale9Image(Rectangle, Bitmap, int, int, int, int, ushort)

Scales a bitmap to fill a rectangular area on the display device using the Scale9Grid technique.

public void Scale9Image(Rectangle destination, Bitmap bitmap, int leftBorder, int topBorder, int rightBorder, int bottomBorder, ushort opacity = 256)

Parameters

destination Rectangle

The rectangular area to which the pixels are to be copied.

bitmap Bitmap

The source bitmap.

leftBorder int

The number of pixels to be left unscaled at the left edge of the source bitmap.

topBorder int

The number of pixels to be left unscaled at the top edge of the source bitmap.

rightBorder int

The number of pixels to be left unscaled at the right edge of the source bitmap.

bottomBorder int

The number of pixels to be left unscaled at the bottom edge of the source bitmap.

opacity ushort

The bitmap's degree of opacity. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

Scale9Image(int, int, int, int, Bitmap, int, int, int, int, ushort)

Scales a bitmap to fill a rectangular area on the display device using the Scale9Grid technique.

public void Scale9Image(int xDst, int yDst, int widthDst, int heightDst, Bitmap bitmap, int leftBorder, int topBorder, int rightBorder, int bottomBorder, ushort opacity = 256)

Parameters

xDst int

The x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

yDst int

The y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

widthDst int

The width of the rectangular area to which the pixels are to be copied.

heightDst int

The height of the rectangular area to which the pixels are to be copied.

bitmap Bitmap

The source bitmap.

leftBorder int

The number of pixels to be left unscaled at the left edge of the source bitmap.

topBorder int

The number of pixels to be left unscaled at the top edge of the source bitmap.

rightBorder int

The number of pixels to be left unscaled at the right edge of the source bitmap.

bottomBorder int

The number of pixels to be left unscaled at the bottom edge of the source bitmap.

opacity ushort

The bitmap's degree of opacity. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all); a value of 255 makes the bitmap completely transparent.

SetClippingRectangle(Rectangle)

Sets the clipping rectangle to restrict drawing to a certain area on the screen.

public void SetClippingRectangle(Rectangle rectangle)

Parameters

rectangle Rectangle

SetClippingRectangle(int, int, int, int)

Sets the clipping rectangle to restrict drawing to a certain area on the screen.

public void SetClippingRectangle(int x, int y, int width, int height)

Parameters

x int

The x-coordinate of the upper-left corner of the clipping rectangle.

y int

The y-coordinate of the upper-left corner of the clipping rectangle.

width int

The width of the clipping rectangle.

height int

The height of the clipping rectangle.

SetPixel(Point, Color)

Sets the color of a specified pixel on the display device.

public void SetPixel(Point point, Color color)

Parameters

point Point

The location of the pixel whose color you want to set.

color Color

The color you want to set for the specified pixel.

SetPixel(int, int, Color)

Sets the color of a specified pixel on the display device.

public void SetPixel(int xPos, int yPos, Color color)

Parameters

xPos int

The x-coordinate of the pixel whose color you want to set.

yPos int

The y-coordinate of the pixel whose color you want to set.

color Color

The color you want to set for the specified pixel.

StretchImage(Point, Bitmap, Size, ushort)

Draws a rectangular block of pixels on the display device, stretching or shrinking the rectangular area as necessary.

public void StretchImage(Point point, Bitmap sourceBitmap, Size size, ushort opacity = 256)

Parameters

point Point

The location of the upper-left corner of the rectangular area to which the pixels are to be copied.

sourceBitmap Bitmap

The source bitmap.

size Size

The size of the stretched image.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all), and a value of 255 makes the bitmap completely transparent.

StretchImage(int, int, int, int, Bitmap, int, int, int, int, ushort)

Stretches a bitmap to fill a rectangular area on the display device.

public void StretchImage(int xDst, int yDst, int widthDst, int heightDst, Bitmap bitmap, int xSrc, int ySrc, int widthSrc, int heightSrc, ushort opacity = 256)

Parameters

xDst int

The x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

yDst int

The y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

widthDst int

The width of the rectangular area to which the pixels are to be copied.

heightDst int

The height of the rectangular area to which the pixels are to be copied.

bitmap Bitmap

The source bitmap to stretch onto the display device.

xSrc int

The x-coordinate of the upper-left corner of the rectangular area from which the pixels are to be copied.

ySrc int

The y-coordinate of the upper-left corner of the rectangular area from which the pixels are to be copied.

widthSrc int

The width of the rectangular area from which the pixels are to be copied.

heightSrc int

The height of the rectangular area from which the pixels are to be copied.

opacity ushort

The bitmap's degree of opacity. A value of 0 makes the bitmap completely opaque; a value of 255 makes the bitmap completely transparent.

StretchImage(int, int, Bitmap, int, int, ushort)

Draws a rectangular block of pixels on the display device, stretching or shrinking the rectangular area as necessary.

public void StretchImage(int xDst, int yDst, Bitmap sourceBitmap, int width, int height, ushort opacity = 256)

Parameters

xDst int

The x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

yDst int

The y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

sourceBitmap Bitmap

The source bitmap.

width int

The width of the rectangular area to which the pixels are to be copied.

height int

The height of the rectangular area to which the pixels are to be copied.

opacity ushort

The degree of opacity of the bitmap. A value of 0 (zero) makes the bitmap completely opaque (not transparent at all), and a value of 255 makes the bitmap completely transparent.

TileImage(Point, Bitmap, Size, ushort)

Tiles an image on the display device.

public void TileImage(Point point, Bitmap bitmap, Size size, ushort opacity = 256)

Parameters

point Point

The location of the upper-left corner of the rectangular area to which the pixels are to be copied.

bitmap Bitmap

The source bitmap to tile onto the display device.

size Size

The size of the tile.

opacity ushort

The bitmap's degree of opacity. A value of 0 makes the bitmap completely opaque; a value of 255 makes the bitmap completely transparent.

TileImage(int, int, Bitmap, int, int, ushort)

Tiles an image on the display device.

public void TileImage(int xDst, int yDst, Bitmap bitmap, int width, int height, ushort opacity = 256)

Parameters

xDst int

The x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

yDst int

The y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.

bitmap Bitmap

The source bitmap to tile onto the display device.

width int

The width of the tile.

height int

The height of the tile.

opacity ushort

The bitmap's degree of opacity. A value of 0 makes the bitmap completely opaque; a value of 255 makes the bitmap completely transparent.