Share via


Bitmap Members

The following tables list the members exposed by the Bitmap type.

Public Constructors

Name Description
Public Method Bitmap Overloaded. Initializes a new instance of the Bitmap class to the specified height and width.

Public Fields

Name Description
Public Field Static BLACKNESS Fills the destination rectangle with the color associated with index number 0 in the physical palette.
Public Field Static CenterX Represents the x-coordinate location of the center of the display device, in pixels.
Public Field Static CenterY Represents the y-coordinate location of the center of the display device, in pixels.
Public Field Static DSTDKGRAY Fills the destination rectangle with a dark gray color.
Public Field Static DSTGRAY Fills the destination rectangle with a gray color.
Public Field Static DSTINVERT Inverts the destination rectangle.
Public Field Static DSTLTGRAY Fills the destination rectangle with a light gray color.
Public Field Static DT_AlignmentCenter Specifies that text is center-aligned as it flows around a bitmap.
Public Field Static DT_AlignmentLeft Specifies that text is left-aligned as it flows around a bitmap.
Public Field Static DT_AlignmentMask Specifies that you can use a mask to get or set text alignment around a bitmap.
Public Field Static DT_AlignmentRight Specifies that text is right-aligned as it flows around a bitmap.
Public Field Static 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.
Public Field Static 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.
Public Field Static DT_None Specifies that there are no format rules.
Public Field DT_TrimmingCharacterEllipsis Obsolete. Please do not use in new applications.
Public Field DT_TrimmingMask Obsolete. Please do not use in new applications.
Public Field DT_TrimmingNone Obsolete. Please do not use in new applications.
Public Field DT_TrimmingWordEllipsis Obsolete. Please do not use in new applications.
Public Field Static DT_TruncateAtBottom Specifies that if the bitmap text is larger than the space provided, the text is truncated at the bottom.
Public Field Static 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.
Public Field Static MaxHeight Specifies the maximum height of the display device, in pixels.
Public Field Static MaxWidth Specifies the maximum width of the display device, in pixels.
Public Field Static OpacityOpaque Specifies that the current bitmap is opaque.
Public Field Static OpacityTransparent Specifies that the current bitmap is transparent.
Public Field Static PATINVERT Inverts the source rectangle.
Public Field Static RANDOM Fills the destination rectangle or circle with a randomly generated pattern.
Public Field Static SINGLEPIXEL Specifies that a circle should have only a single-pixel border and no fill pattern or color.
Public Field Static SRCCOPY Copies the source rectangle directly to the destination rectangle.
Public Field Static WHITENESS Fills the destination rectangle with the color associated with index number 1 in the physical palette.

Public Properties

Name Description
Public Property Height Gets the height of the current bitmap.
Public Property Width Gets the width of the current bitmap.

Public Methods

Name Description
Public Method 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.
Public Method Circle Draws a circle specified by a coordinate pair (x and y) and a radius, using a specified raster operation.
Public Method Clear Clears the entire drawing surface.
Public Method DrawEllipse Overloaded. Draws a filled ellipse on the display device.
Public Method DrawImage Overloaded. Draws a rectangular block of pixels on the display device.
Public Method DrawLine Draws a line on the display device.
Public Method DrawRectangle Overloaded. Draws a rectangle on the display device.
Public Method DrawText Overloaded. Draws text on the display device.
Public Method DrawTextInRect Overloaded. Draws text in a specified rectangle.
Public Method Equals (Inherited from Object.)
Public Method Flush Overloaded. Flushes the current bitmap to the display device.
Public Method GetHashCode (Inherited from Object.)
Public Method GetPixel Retrieves the pixel color at a specified location on the display device.
Public Method GetType (Inherited from Object.)
Public Method Line Draws a line connecting the two points specified by two coordinate (x,y) pairs.
Public Method MakeTransparent Sets a bitmap's transparent color.
Public Method MaskBlt Combines the data for the source bitmap and the current (destination) bitmap, using the specified mask.
Public Method PatBlt Creates a bit pattern on a bitmap.
Public Method ReferenceEquals (Inherited from Object.)
Public Method ResetClippingRectangle Resets a bitmap's clipping region (clipping rectangle) to the entire bitmap.
Public Method RotateBlt Rotates a bitmap to a specified degree around a specified point.
Public Method SetClippingRectangle Sets the clipping region (clipping rectangle) of a bitmap with a specified coordinate pair (x,y), width, and height.
Public Method SetPixel Overloaded. Turns a specified pixel on or off.
Public Method StretchImage Draws a rectangular block of pixels on the display device, stretching or shrinking the rectangular area as necessary.
Public Method ToString (Inherited from Object.)
Public Method TransparentBlt Combines the data for the specified source bitmap and the current bitmap (destination bitmap) in a defined rectangular area.

Protected Methods

Name Description
Protected Method Finalize (Inherited from Object.)
Protected Method MemberwiseClone (Inherited from Object.)

Remarks

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