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.BitmapImageTypeThe 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
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
Fields
CenterX
Gets the x-coordinate location of the center of the display device, in pixels.
public static readonly int CenterX
Field Value
CenterY
Gets the y-coordinate location of the center of the display device, in pixels.
public static readonly int CenterY
Field Value
MaxHeight
Gets the maximum height of the display device, in pixels.
public static readonly int MaxHeight
Field Value
MaxWidth
Gets the maximum width of the display device, in pixels.
public static readonly int MaxWidth
Field Value
OpacityOpaque
Specifies that the current bitmap is opaque.
public const ushort OpacityOpaque = 256
Field Value
OpacityTransparent
Specifies that the current bitmap is transparent.
public const ushort OpacityTransparent = 0
Field Value
Properties
Height
Gets the height of the current bitmap.
public int Height { get; }
Property Value
Width
Gets the width of the current bitmap.
public int Width { get; }
Property Value
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
ushortThe character to draw.
x
intThe x-coordinate of the upper-left corner to draw to.
y
intThe y-coordinate of the upper-left corner to draw to.
color
ColorThe color to be used for the character.
font
FontThe 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
ColorThe outline color.
point
PointThe location of the center of the ellipse.
xRadius
intThe radius of the ellipse in the x-coordinate direction.
yRadius
intThe 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
ColorThe outline color.
thicknessOutline
intThe thickness of the ellipse's outline, in pixels.
point
PointThe location of the center of the ellipse.
xRadius
intThe radius of the ellipse in the x-coordinate direction.
yRadius
intThe radius of the ellipse in the y-coordinate direction.
colorGradientStart
ColorThe starting color of the color gradient.
gradientStartPoint
PointThe location of the starting point of the color gradient.
colorGradientEnd
ColorThe ending color of the color gradient.
gradientEndPoint
PointThe location of the ending point of the color gradient.
opacity
ushortThe 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
ColorThe outline color.
x
intThe x-coordinate location of the center of the ellipse.
y
intThe y-coordinate location of the center of the ellipse.
xRadius
intThe radius of the ellipse in the x-coordinate direction.
yRadius
intThe 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
ColorThe outline color.
thicknessOutline
intThe thickness of the ellipse's outline, in pixels.
x
intThe x-coordinate location of the center of the ellipse.
y
intThe y-coordinate location of the center of the ellipse.
xRadius
intThe radius of the ellipse in the x-coordinate direction.
yRadius
intThe radius of the ellipse in the y-coordinate direction.
colorGradientStart
ColorThe starting color of the color gradient.
xGradientStart
intThe x-coordinate location of the starting point of the color gradient.
yGradientStart
intThe y-coordinate location of the starting point of the color gradient.
colorGradientEnd
ColorThe ending color of the color gradient.
xGradientEnd
intThe x-coordinate location of the ending point of the color gradient.
yGradientEnd
intThe y-coordinate location of the ending point of the color gradient.
opacity
ushortThe 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
PointThe location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.
bitmap
BitmapThe source bitmap.
rectangle
RectangleThe rectangle of pixels to be copied.
opacity
ushortThe 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
PointThe location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.
bitmap
BitmapThe source bitmap.
opacity
ushortThe 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
intThe 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
intThe 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
BitmapThe source bitmap.
xSrc
intThe 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
intThe 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
intThe width of the rectangular block of pixels to be copied.
height
intThe height of the rectangular block of pixels to be copied.
opacity
ushortThe 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
ColorThe color of the line.
thickness
intThe thickness of the line, in pixels. (Not currently available; all lines are one pixel thick.)
start
PointThe location of the line's starting point.
end
PointThe 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
ColorThe color of the line.
thickness
intThe thickness of the line, in pixels. (Not currently available; all lines are one pixel thick.)
x0
intThe x-coordinate of the line's starting point.
y0
intThe y-coordinate of the line's starting point.
x1
intThe x-coordinate of the line's ending point.
y1
intThe 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
ColorThe color of the rectangle's outline.
thicknessOutline
intThe thickness of the rectangle's outline, in pixels.
rectangle
RectangleThe rectangle to draw.
xCornerRadius
intThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadius
intThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorGradientStart
ColorThe starting color for a color gradient.
gradientStartPoint
PointThe location of the starting point of the color gradient.
colorGradientEnd
ColorSpecifies the ending color of the color gradient.
gradientEndPoint
PointThe location of the ending point of the color gradient.
opacity
ushortSpecifies 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
ColorThe color of the rectangle's outline.
thicknessOutline
intThe thickness of the rectangle's outline, in pixels.
x
intThe x-coordinate of the rectangle's upper-left corner.
y
intThe y-coordinate of the rectangle's upper-left corner.
width
intThe width of the rectangle, in pixels.
height
intThe height of the rectangle, in pixels.
xCornerRadius
intThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadius
intThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorGradientStart
ColorThe starting color for a color gradient.
xGradientStart
intThe x-coordinate location of the starting point of the color gradient.
yGradientStart
intThe y-coordinate location of the starting point of the color gradient.
colorGradientEnd
ColorThe ending color of the color gradient.
xGradientEnd
intThe x-coordinate location of the ending point of the color gradient.
yGradientEnd
intThe y-coordinate location of the ending point of the color gradient.
opacity
ushortSpecifies 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
RectangleThe rectangle to draw.
thickness
intThe thickness of the rectangle's outline, in pixels.
color
ColorThe 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
intThe x-coordinate of the rectangle's upper-left corner.
y
intThe y-coordinate of the rectangle's upper-left corner.
width
intThe width of the rectangle, in pixels.
height
intThe height of the rectangle, in pixels.
thickness
intThe thickness of the rectangle's outline, in pixels.
color
ColorThe 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
RectangleThe rectangle to draw.
thickness
intThe thickness of the rectangle's outline, in pixels.
cornerRadius
intThe corner radius used to produce rounded corners on the rectangle.
color
ColorThe 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
RectangleThe rectangle to draw.
thickness
intThe thickness of the rectangle's outline, in pixels.
xCornerRadius
intThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadius
intThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
color
ColorThe 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
intThe x-coordinate of the rectangle's upper-left corner.
y
intThe y-coordinate of the rectangle's upper-left corner.
width
intThe width of the rectangle, in pixels.
height
intThe height of the rectangle, in pixels.
thickness
intThe thickness of the rectangle's outline, in pixels.
xCornerRadius
intThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadius
intThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
color
ColorThe 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
stringThe text to be drawn.
font
FontThe font to be used for the text.
color
ColorThe color to be used for the text.
point
PointThe 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
stringThe text to be drawn.
font
FontThe font to be used for the text.
color
ColorThe color to be used for the text.
x
intThe x-coordinate of the location where the text drawing is to begin.
y
intThe 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
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
stringThe 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
intThe x-coordinate of the upper-left corner of the rectangle.
y
intThe y-coordinate of the upper-left corner of the rectangle.
width
intThe width of the rectangle.
height
intThe height of the rectangle.
dtFlags
uintFlags that specify the format of the text.
color
ColorThe color to be used for the text.
font
FontThe 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
stringThe 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
intThe x-coordinate, relative to the rectangle, at which text drawing is to begin.
yRelStart
intThe y-coordinate, relative to the rectangle, at which text drawing is to begin.
x
intThe x-coordinate of the upper-left corner of the rectangle.
y
intThe y-coordinate of the upper-left corner of the rectangle.
width
intThe width of the rectangle.
height
intThe height of the rectangle.
dtFlags
uintFlags that specify the format of the text.
color
ColorThe color to be used for the text.
font
FontThe 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
RectangleThe rectangle to draw.
colorGradientStart
ColorThe starting color for the color gradient.
gradientStartPoint
PointThe starting location of the color gradient.
colorGradientEnd
ColorThe ending color of the color gradient.
gradientEndPoint
PointThe ending location of the color gradient.
opacity
ushortThe 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
intThe x-coordinate of the rectangle's upper-left corner.
y
intThe y-coordinate of the rectangle's upper-left corner.
width
intThe width of the rectangle, in pixels.
height
intThe height of the rectangle, in pixels.
colorGradientStart
ColorThe starting color for the color gradient.
xGradientStart
intThe x-coordinate of the starting location of the color gradient.
yGradientStart
intThe y-coordinate of the starting location of the color gradient.
colorGradientEnd
ColorThe ending color of the color gradient.
xGradientEnd
intThe x-coordinate of the ending location of the color gradient.
yGradientEnd
intThe y-coordinate of the ending location of the color gradient.
opacity
ushortThe 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
RectangleThe rectangle to draw.
color
ColorThe color of the rectangle's outline.
opacity
ushortSpecifies 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
intThe x-coordinate of the rectangle's upper-left corner.
y
intThe y-coordinate of the rectangle's upper-left corner.
width
intThe width of the rectangle, in pixels.
height
intThe height of the rectangle, in pixels.
color
ColorThe color of the rectangle's outline.
opacity
ushortSpecifies 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
RectangleThe rectangle to draw.
cornerRadius
intThe corner radius used to produce rounded corners on the rectangle.
color
ColorThe color of the rectangle's outline.
opacity
ushortSpecifies 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
RectangleThe rectangle to draw.
xCornerRadius
intThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadius
intThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
color
ColorThe color of the rectangle's outline.
opacity
ushortSpecifies 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
intThe x-coordinate of the rectangle's upper-left corner.
y
intThe y-coordinate of the rectangle's upper-left corner.
width
intThe width of the rectangle, in pixels.
height
intThe height of the rectangle, in pixels.
xCornerRadius
intThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadius
intThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
color
ColorThe color of the rectangle's outline.
opacity
ushortSpecifies 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
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
intThe x-coordinate of the sub-rectangle's upper-left corner.
y
intThe y-coordinate of the sub-rectangle's upper-left corner.
width
intThe width of the sub-rectangle.
height
intThe 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
intThe x-coordinate of the sub-rectangle's upper-left corner.
srcY
intThe y-coordinate of the sub-rectangle's upper-left corner.
width
intThe width of the sub-rectangle.
height
intThe height of the sub-rectangle.
screenX
intThe x-coordinate of the screen to write to.
screenY
intThe 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
PointThe 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
intThe x-coordinate of the pixel whose color you want to get.
yPos
intThe 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
ColorThe 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
intThe degree of rotation.
point
PointThe location of the center of the destination bitmap.
bitmap
BitmapThe source bitmap.
rectangle
RectangleThe rectangle of the source bitmap.
opacity
ushortThe 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
intThe degree of rotation.
point
PointThe location of the center of the destination bitmap.
bitmap
BitmapThe source bitmap.
opacity
ushortThe 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
intThe degree of rotation.
xDst
intThe x-coordinate of the center of the destination bitmap.
yDst
intThe y-coordinate of the center of the destination bitmap.
bitmap
BitmapThe source bitmap.
xSrc
intThe x-coordinate of the center of the source bitmap.
ySrc
intThe y-coordinate of the center of the source bitmap.
width
intThe width of the rectangular block of pixels to be copied.
height
intThe height of the rectangular block of pixels to be copied.
opacity
ushortThe 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
RectangleThe rectangular area to which the pixels are to be copied.
bitmap
BitmapThe source bitmap.
leftBorder
intThe number of pixels to be left unscaled at the left edge of the source bitmap.
topBorder
intThe number of pixels to be left unscaled at the top edge of the source bitmap.
rightBorder
intThe number of pixels to be left unscaled at the right edge of the source bitmap.
bottomBorder
intThe number of pixels to be left unscaled at the bottom edge of the source bitmap.
opacity
ushortThe 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
intThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDst
intThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
widthDst
intThe width of the rectangular area to which the pixels are to be copied.
heightDst
intThe height of the rectangular area to which the pixels are to be copied.
bitmap
BitmapThe source bitmap.
leftBorder
intThe number of pixels to be left unscaled at the left edge of the source bitmap.
topBorder
intThe number of pixels to be left unscaled at the top edge of the source bitmap.
rightBorder
intThe number of pixels to be left unscaled at the right edge of the source bitmap.
bottomBorder
intThe number of pixels to be left unscaled at the bottom edge of the source bitmap.
opacity
ushortThe 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
intThe x-coordinate of the upper-left corner of the clipping rectangle.
y
intThe y-coordinate of the upper-left corner of the clipping rectangle.
width
intThe width of the clipping rectangle.
height
intThe 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
PointThe location of the pixel whose color you want to set.
color
ColorThe 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
intThe x-coordinate of the pixel whose color you want to set.
yPos
intThe y-coordinate of the pixel whose color you want to set.
color
ColorThe 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
PointThe location of the upper-left corner of the rectangular area to which the pixels are to be copied.
sourceBitmap
BitmapThe source bitmap.
size
SizeThe size of the stretched image.
opacity
ushortThe 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
intThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDst
intThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
widthDst
intThe width of the rectangular area to which the pixels are to be copied.
heightDst
intThe height of the rectangular area to which the pixels are to be copied.
bitmap
BitmapThe source bitmap to stretch onto the display device.
xSrc
intThe x-coordinate of the upper-left corner of the rectangular area from which the pixels are to be copied.
ySrc
intThe y-coordinate of the upper-left corner of the rectangular area from which the pixels are to be copied.
widthSrc
intThe width of the rectangular area from which the pixels are to be copied.
heightSrc
intThe height of the rectangular area from which the pixels are to be copied.
opacity
ushortThe 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
intThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDst
intThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
sourceBitmap
BitmapThe source bitmap.
width
intThe width of the rectangular area to which the pixels are to be copied.
height
intThe height of the rectangular area to which the pixels are to be copied.
opacity
ushortThe 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
PointThe location of the upper-left corner of the rectangular area to which the pixels are to be copied.
bitmap
BitmapThe source bitmap to tile onto the display device.
size
SizeThe size of the tile.
opacity
ushortThe 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
intThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDst
intThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
bitmap
BitmapThe source bitmap to tile onto the display device.
width
intThe width of the tile.
height
intThe height of the tile.
opacity
ushortThe bitmap's degree of opacity. A value of 0 makes the bitmap completely opaque; a value of 255 makes the bitmap completely transparent.