Bitmap Members
In this article
The following tables list the members exposed by the Bitmap type.
Public Constructors
Bitmap
Overloaded. Initializes a new instance of the Bitmap class to the specified height and width.
Public Fields
BLACKNESS
Fills the destination rectangle with the color associated with index number 0 in the physical palette.
CenterX
Represents the x-coordinate location of the center of the display device, in pixels.
CenterY
Represents the y-coordinate location of the center of the display device, in pixels.
DSTDKGRAY
Fills the destination rectangle with a dark gray color.
DSTGRAY
Fills the destination rectangle with a gray color.
DSTINVERT
Inverts the destination rectangle.
DSTLTGRAY
Fills the destination rectangle with a light gray color.
DT_AlignmentCenter
Specifies that text is center-aligned as it flows around a bitmap.
DT_AlignmentLeft
Specifies that text is left-aligned as it flows around a bitmap.
DT_AlignmentMask
Specifies that you can use a mask to get or set text alignment around a bitmap.
DT_AlignmentRight
Specifies that text is right-aligned as it flows around a bitmap.
DT_Ellipsis
Specifies that the bitmap text is trimmed to the nearest character, and an ellipsis is inserted at the end of each trimmed line.
DT_IgnoreHeight
Specifies that if the bitmap text is larger than the space provided, the text is drawn in its full size, rather than being scaled down to fit the value in the Height property.
DT_None
Specifies that there are no format rules.
DT_TrimmingCharacterEllipsis
Obsolete. Please do not use in new applications.
DT_TrimmingMask
Obsolete. Please do not use in new applications.
DT_TrimmingNone
Obsolete. Please do not use in new applications.
DT_TrimmingWordEllipsis
Obsolete. Please do not use in new applications.
DT_TruncateAtBottom
Specifies that if the bitmap text is larger than the space provided, the text is truncated at the bottom.
DT_WordWrap
Specifies whether a line of bitmap text automatically wraps words to the beginning of the next line when the line reaches its maximum width.
MaxHeight
Specifies the maximum height of the display device, in pixels.
MaxWidth
Specifies the maximum width of the display device, in pixels.
OpacityOpaque
Specifies that the current bitmap is opaque.
OpacityTransparent
Specifies that the current bitmap is transparent.
PATINVERT
Inverts the source rectangle.
RANDOM
Fills the destination rectangle or circle with a randomly generated pattern.
SINGLEPIXEL
Specifies that a circle should have only a single-pixel border and no fill pattern or color.
SRCCOPY
Copies the source rectangle directly to the destination rectangle.
WHITENESS
Fills the destination rectangle with the color associated with index number 1 in the physical palette.
Public Properties
Height
Gets the height of the current bitmap.
Width
Gets the width of the current bitmap.
Public Methods
BitBlt
Performs a bit block transfer of the bitmap data corresponding to a rectangle of pixels, transferring the data from a specified source bitmap into the current destination bitmap.
Circle
Draws a circle specified by a coordinate pair (x and y) and a radius, using a specified raster operation.
Clear
Clears the entire drawing surface.
DrawEllipse
Overloaded. Draws a filled ellipse on the display device.
DrawImage
Overloaded. Draws a rectangular block of pixels on the display device.
DrawLine
Draws a line on the display device.
DrawRectangle
Overloaded. Draws a rectangle on the display device.
DrawText
Overloaded. Draws text on the display device.
DrawTextInRect
Overloaded. Draws text in a specified rectangle.
Equals
(Inherited from Object .)
Flush
Overloaded. Flushes the current bitmap to the display device.
GetHashCode
(Inherited from Object .)
GetPixel
Retrieves the pixel color at a specified location on the display device.
GetType
(Inherited from Object .)
Line
Draws a line connecting the two points specified by two coordinate (x,y) pairs.
MakeTransparent
Sets a bitmap's transparent color.
MaskBlt
Combines the data for the source bitmap and the current (destination) bitmap, using the specified mask.
PatBlt
Creates a bit pattern on a bitmap.
ReferenceEquals
(Inherited from Object .)
ResetClippingRectangle
Resets a bitmap's clipping region (clipping rectangle) to the entire bitmap.
RotateBlt
Rotates a bitmap to a specified degree around a specified point.
SetClippingRectangle
Sets the clipping region (clipping rectangle) of a bitmap with a specified coordinate pair (x,y), width, and height.
SetPixel
Overloaded. Turns a specified pixel on or off.
StretchImage
Draws a rectangular block of pixels on the display device, stretching or shrinking the rectangular area as necessary.
ToString
(Inherited from Object .)
TransparentBlt
Combines the data for the specified source bitmap and the current bitmap (destination bitmap) in a defined rectangular area.
Protected Methods
The .NET Micro Framework provides the Microsoft.SPOT.Bitmap class for backward compatibility with existing applications. However, this class is not supported for new applications, and you should not use it in your .NET Micro Framework programs. Instead, the framework now provides the Windows Presentation Foundation (WPF) in the following namespaces:
Microsoft.SPOT.Input
Microsoft.SPOT.Presentation
Microsoft.SPOT.Presentation.Controls
Microsoft.SPOT.Presentation.Media
Microsoft.SPOT.Presentation.Shapes
If a bitmap is embedded as a resource, and its BitmapImageType is Bmp , then the Bitmap object is read-only, and attempts to modify it will throw an exception. You must make a copy of it using Bitmap.DrawImage, and modify the copy, as shown in the following code:
Bitmap bmpMyBitmap = Resources.GetBitmap(Resources.BitmapResources.MyBitmap);
Bitmap bmpCopy = new Bitmap(bmpMyBitmap.Width, bmpMyBitmap.Height);
// copy the bitmap
bmpCopy.DrawImage(0, 0, bmpMyBitmap, 0, 0, bmpMyBitmap.Width, bmpMyBitmap.Height);
// now you may modify the copy using any Bitmap method
bmpCopy.MakeTransparent(Microsoft.SPOT.Presentation.Media.Color.White);
See Also
Reference
Bitmap Class
Microsoft.SPOT Namespace