Bitmap.DrawEllipse Method (Color, Int32, Int32, Int32, Int32, Int32, Color, Int32, Int32, Color, Int32, Int32, Double)

Draws an ellipse filled with a specified color gradient.

Namespace: Microsoft.SPOT
Assembly: Microsoft.SPOT.Graphics (in microsoft.spot.graphics.dll)

 [MethodImplAttribute]
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,
         double opacity
) 

Parameters

colorOutline
The outline color.
thicknessOutline
The thickness of the ellipse's outline, in pixels.
x
The x-coordinate location of the center of the ellipse.
y
The y-coordinate location of the center of the ellipse.
xRadius
The radius of the ellipse in the x-coordinate direction.
yRadius
The radius of the ellipse in the y-coordinate direction.
colorGradientStart
The starting color of the color gradient.
xGradientStart
The x-coordinate location of the starting point of the color gradient.
yGradientStart
The y-coordinate location of the starting point of the color gradient.
colorGradientEnd
The ending color of the color gradient.
xGradientEnd
The x-coordinate location of the ending point of the color gradient.
yGradientEnd
The y-coordinate location of the ending point of the color gradient.
opacity
The opacity of the ellipse.

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);
      

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

Available in .NET Micro Framework version 2.0, 2.5

Show: