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
imageDatabyte[]An array of pixel data for the specified image.
typeBitmap.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
cushortThe character to draw.
xintThe x-coordinate of the upper-left corner to draw to.
yintThe y-coordinate of the upper-left corner to draw to.
colorColorThe color to be used for the character.
fontFontThe 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
colorOutlineColorThe outline color.
pointPointThe location of the center of the ellipse.
xRadiusintThe radius of the ellipse in the x-coordinate direction.
yRadiusintThe 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
colorOutlineColorThe outline color.
thicknessOutlineintThe thickness of the ellipse's outline, in pixels.
pointPointThe location of the center of the ellipse.
xRadiusintThe radius of the ellipse in the x-coordinate direction.
yRadiusintThe radius of the ellipse in the y-coordinate direction.
colorGradientStartColorThe starting color of the color gradient.
gradientStartPointPointThe location of the starting point of the color gradient.
colorGradientEndColorThe ending color of the color gradient.
gradientEndPointPointThe location of the ending point of the color gradient.
opacityushortThe 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
colorOutlineColorThe outline color.
xintThe x-coordinate location of the center of the ellipse.
yintThe y-coordinate location of the center of the ellipse.
xRadiusintThe radius of the ellipse in the x-coordinate direction.
yRadiusintThe 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
colorOutlineColorThe outline color.
thicknessOutlineintThe thickness of the ellipse's outline, in pixels.
xintThe x-coordinate location of the center of the ellipse.
yintThe y-coordinate location of the center of the ellipse.
xRadiusintThe radius of the ellipse in the x-coordinate direction.
yRadiusintThe radius of the ellipse in the y-coordinate direction.
colorGradientStartColorThe starting color of the color gradient.
xGradientStartintThe x-coordinate location of the starting point of the color gradient.
yGradientStartintThe y-coordinate location of the starting point of the color gradient.
colorGradientEndColorThe ending color of the color gradient.
xGradientEndintThe x-coordinate location of the ending point of the color gradient.
yGradientEndintThe y-coordinate location of the ending point of the color gradient.
opacityushortThe 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
pointPointThe location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.
bitmapBitmapThe source bitmap.
rectangleRectangleThe rectangle of pixels to be copied.
opacityushortThe 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
pointPointThe location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.
bitmapBitmapThe source bitmap.
opacityushortThe 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
xDstintThe x-coordinate location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.
yDstintThe y-coordinate location of the upper-left corner of the rectangular area on the display to which the specified pixels are to be copied.
bitmapBitmapThe source bitmap.
xSrcintThe 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.
ySrcintThe 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.
widthintThe width of the rectangular block of pixels to be copied.
heightintThe height of the rectangular block of pixels to be copied.
opacityushortThe 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
colorColorThe color of the line.
thicknessintThe thickness of the line, in pixels. (Not currently available; all lines are one pixel thick.)
startPointThe location of the line's starting point.
endPointThe 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
colorColorThe color of the line.
thicknessintThe thickness of the line, in pixels. (Not currently available; all lines are one pixel thick.)
x0intThe x-coordinate of the line's starting point.
y0intThe y-coordinate of the line's starting point.
x1intThe x-coordinate of the line's ending point.
y1intThe 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
colorOutlineColorThe color of the rectangle's outline.
thicknessOutlineintThe thickness of the rectangle's outline, in pixels.
rectangleRectangleThe rectangle to draw.
xCornerRadiusintThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadiusintThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorGradientStartColorThe starting color for a color gradient.
gradientStartPointPointThe location of the starting point of the color gradient.
colorGradientEndColorSpecifies the ending color of the color gradient.
gradientEndPointPointThe location of the ending point of the color gradient.
opacityushortSpecifies 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
colorOutlineColorThe color of the rectangle's outline.
thicknessOutlineintThe thickness of the rectangle's outline, in pixels.
xintThe x-coordinate of the rectangle's upper-left corner.
yintThe y-coordinate of the rectangle's upper-left corner.
widthintThe width of the rectangle, in pixels.
heightintThe height of the rectangle, in pixels.
xCornerRadiusintThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadiusintThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorGradientStartColorThe starting color for a color gradient.
xGradientStartintThe x-coordinate location of the starting point of the color gradient.
yGradientStartintThe y-coordinate location of the starting point of the color gradient.
colorGradientEndColorThe ending color of the color gradient.
xGradientEndintThe x-coordinate location of the ending point of the color gradient.
yGradientEndintThe y-coordinate location of the ending point of the color gradient.
opacityushortSpecifies 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
rectangleRectangleThe rectangle to draw.
thicknessintThe thickness of the rectangle's outline, in pixels.
colorColorThe 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
xintThe x-coordinate of the rectangle's upper-left corner.
yintThe y-coordinate of the rectangle's upper-left corner.
widthintThe width of the rectangle, in pixels.
heightintThe height of the rectangle, in pixels.
thicknessintThe thickness of the rectangle's outline, in pixels.
colorColorThe 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
rectangleRectangleThe rectangle to draw.
thicknessintThe thickness of the rectangle's outline, in pixels.
cornerRadiusintThe corner radius used to produce rounded corners on the rectangle.
colorColorThe 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
rectangleRectangleThe rectangle to draw.
thicknessintThe thickness of the rectangle's outline, in pixels.
xCornerRadiusintThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadiusintThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorColorThe 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
xintThe x-coordinate of the rectangle's upper-left corner.
yintThe y-coordinate of the rectangle's upper-left corner.
widthintThe width of the rectangle, in pixels.
heightintThe height of the rectangle, in pixels.
thicknessintThe thickness of the rectangle's outline, in pixels.
xCornerRadiusintThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadiusintThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorColorThe 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
textstringThe text to be drawn.
fontFontThe font to be used for the text.
colorColorThe color to be used for the text.
pointPointThe 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
textstringThe text to be drawn.
fontFontThe font to be used for the text.
colorColorThe color to be used for the text.
xintThe x-coordinate of the location where the text drawing is to begin.
yintThe 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
textstringThe 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.
xintThe x-coordinate of the upper-left corner of the rectangle.
yintThe y-coordinate of the upper-left corner of the rectangle.
widthintThe width of the rectangle.
heightintThe height of the rectangle.
dtFlagsuintFlags that specify the format of the text.
colorColorThe color to be used for the text.
fontFontThe 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
textstringThe 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.
xRelStartintThe x-coordinate, relative to the rectangle, at which text drawing is to begin.
yRelStartintThe y-coordinate, relative to the rectangle, at which text drawing is to begin.
xintThe x-coordinate of the upper-left corner of the rectangle.
yintThe y-coordinate of the upper-left corner of the rectangle.
widthintThe width of the rectangle.
heightintThe height of the rectangle.
dtFlagsuintFlags that specify the format of the text.
colorColorThe color to be used for the text.
fontFontThe 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
rectangleRectangleThe rectangle to draw.
colorGradientStartColorThe starting color for the color gradient.
gradientStartPointPointThe starting location of the color gradient.
colorGradientEndColorThe ending color of the color gradient.
gradientEndPointPointThe ending location of the color gradient.
opacityushortThe 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
xintThe x-coordinate of the rectangle's upper-left corner.
yintThe y-coordinate of the rectangle's upper-left corner.
widthintThe width of the rectangle, in pixels.
heightintThe height of the rectangle, in pixels.
colorGradientStartColorThe starting color for the color gradient.
xGradientStartintThe x-coordinate of the starting location of the color gradient.
yGradientStartintThe y-coordinate of the starting location of the color gradient.
colorGradientEndColorThe ending color of the color gradient.
xGradientEndintThe x-coordinate of the ending location of the color gradient.
yGradientEndintThe y-coordinate of the ending location of the color gradient.
opacityushortThe 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
rectangleRectangleThe rectangle to draw.
colorColorThe color of the rectangle's outline.
opacityushortSpecifies 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
xintThe x-coordinate of the rectangle's upper-left corner.
yintThe y-coordinate of the rectangle's upper-left corner.
widthintThe width of the rectangle, in pixels.
heightintThe height of the rectangle, in pixels.
colorColorThe color of the rectangle's outline.
opacityushortSpecifies 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
rectangleRectangleThe rectangle to draw.
cornerRadiusintThe corner radius used to produce rounded corners on the rectangle.
colorColorThe color of the rectangle's outline.
opacityushortSpecifies 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
rectangleRectangleThe rectangle to draw.
xCornerRadiusintThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadiusintThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorColorThe color of the rectangle's outline.
opacityushortSpecifies 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
xintThe x-coordinate of the rectangle's upper-left corner.
yintThe y-coordinate of the rectangle's upper-left corner.
widthintThe width of the rectangle, in pixels.
heightintThe height of the rectangle, in pixels.
xCornerRadiusintThe x-coordinate value of the corner radius used to produce rounded corners on the rectangle.
yCornerRadiusintThe y-coordinate value of the corner radius used to produce rounded corners on the rectangle.
colorColorThe color of the rectangle's outline.
opacityushortSpecifies 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
rectangleRectangle
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
xintThe x-coordinate of the sub-rectangle's upper-left corner.
yintThe y-coordinate of the sub-rectangle's upper-left corner.
widthintThe width of the sub-rectangle.
heightintThe 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
srcXintThe x-coordinate of the sub-rectangle's upper-left corner.
srcYintThe y-coordinate of the sub-rectangle's upper-left corner.
widthintThe width of the sub-rectangle.
heightintThe height of the sub-rectangle.
screenXintThe x-coordinate of the screen to write to.
screenYintThe 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
pointPointThe 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
xPosintThe x-coordinate of the pixel whose color you want to get.
yPosintThe 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
colorColorThe 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
angleintThe degree of rotation.
pointPointThe location of the center of the destination bitmap.
bitmapBitmapThe source bitmap.
rectangleRectangleThe rectangle of the source bitmap.
opacityushortThe 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
angleintThe degree of rotation.
pointPointThe location of the center of the destination bitmap.
bitmapBitmapThe source bitmap.
opacityushortThe 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
angleintThe degree of rotation.
xDstintThe x-coordinate of the center of the destination bitmap.
yDstintThe y-coordinate of the center of the destination bitmap.
bitmapBitmapThe source bitmap.
xSrcintThe x-coordinate of the center of the source bitmap.
ySrcintThe y-coordinate of the center of the source bitmap.
widthintThe width of the rectangular block of pixels to be copied.
heightintThe height of the rectangular block of pixels to be copied.
opacityushortThe 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
destinationRectangleThe rectangular area to which the pixels are to be copied.
bitmapBitmapThe source bitmap.
leftBorderintThe number of pixels to be left unscaled at the left edge of the source bitmap.
topBorderintThe number of pixels to be left unscaled at the top edge of the source bitmap.
rightBorderintThe number of pixels to be left unscaled at the right edge of the source bitmap.
bottomBorderintThe number of pixels to be left unscaled at the bottom edge of the source bitmap.
opacityushortThe 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
xDstintThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDstintThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
widthDstintThe width of the rectangular area to which the pixels are to be copied.
heightDstintThe height of the rectangular area to which the pixels are to be copied.
bitmapBitmapThe source bitmap.
leftBorderintThe number of pixels to be left unscaled at the left edge of the source bitmap.
topBorderintThe number of pixels to be left unscaled at the top edge of the source bitmap.
rightBorderintThe number of pixels to be left unscaled at the right edge of the source bitmap.
bottomBorderintThe number of pixels to be left unscaled at the bottom edge of the source bitmap.
opacityushortThe 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
rectangleRectangle
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
xintThe x-coordinate of the upper-left corner of the clipping rectangle.
yintThe y-coordinate of the upper-left corner of the clipping rectangle.
widthintThe width of the clipping rectangle.
heightintThe 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
pointPointThe location of the pixel whose color you want to set.
colorColorThe 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
xPosintThe x-coordinate of the pixel whose color you want to set.
yPosintThe y-coordinate of the pixel whose color you want to set.
colorColorThe 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
pointPointThe location of the upper-left corner of the rectangular area to which the pixels are to be copied.
sourceBitmapBitmapThe source bitmap.
sizeSizeThe size of the stretched image.
opacityushortThe 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
xDstintThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDstintThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
widthDstintThe width of the rectangular area to which the pixels are to be copied.
heightDstintThe height of the rectangular area to which the pixels are to be copied.
bitmapBitmapThe source bitmap to stretch onto the display device.
xSrcintThe x-coordinate of the upper-left corner of the rectangular area from which the pixels are to be copied.
ySrcintThe y-coordinate of the upper-left corner of the rectangular area from which the pixels are to be copied.
widthSrcintThe width of the rectangular area from which the pixels are to be copied.
heightSrcintThe height of the rectangular area from which the pixels are to be copied.
opacityushortThe 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
xDstintThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDstintThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
sourceBitmapBitmapThe source bitmap.
widthintThe width of the rectangular area to which the pixels are to be copied.
heightintThe height of the rectangular area to which the pixels are to be copied.
opacityushortThe 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
pointPointThe location of the upper-left corner of the rectangular area to which the pixels are to be copied.
bitmapBitmapThe source bitmap to tile onto the display device.
sizeSizeThe size of the tile.
opacityushortThe 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
xDstintThe x-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
yDstintThe y-coordinate of the upper-left corner of the rectangular area to which the pixels are to be copied.
bitmapBitmapThe source bitmap to tile onto the display device.
widthintThe width of the tile.
heightintThe height of the tile.
opacityushortThe bitmap's degree of opacity. A value of 0 makes the bitmap completely opaque; a value of 255 makes the bitmap completely transparent.