C# Class AGENT.Contrib.Drawing.Drawing

Datei anzeigen Open project: nothingmn/AGENT.Contrib Class Usage Examples

Public Methods

Method Description
DrawAlignedText ( Microsoft.SPOT.Bitmap screen, System.Color color, Microsoft.SPOT.Font font, string inString, HAlign align, int margin, VAlign vAlign, int vMargin ) : void

Draw text in a vertical and horizontal position When "align" is "Center" then "margin" is ignored. Also when "vAlign" is "Middle" then "vMargin" is ignored.

DrawBattery ( Microsoft.SPOT.Bitmap screen, Point batteryPosition, int batteryWidth, int batteryHeight, int borderThickness, System.Color batteryColor, System.Color backColor, bool charging, int batteryLevel ) : Size

Draw a simple battery to the screen

DrawImageAtPoint ( Microsoft.SPOT.Bitmap screen, byte imageData, Microsoft.SPOT.Bitmap imageType, Point point ) : void

Draw an image at a specific points

DrawImageCentered ( Microsoft.SPOT.Bitmap screen, byte imageData, Microsoft.SPOT.Bitmap imageType ) : void

Draw an image centered

DrawPoly ( Microsoft.SPOT.Bitmap screen, Point points, System.Color borderColor, short borderWidth, System.Color fillColor, PolyFill polyFill ) : void

Draws polygon from list of points and fill it with specififed pattern.

DrawTextCentered ( Microsoft.SPOT.Bitmap screen, string text, Microsoft.SPOT.Font font, System.Color color ) : void

Draw text right in the center of the screen

DrawTray ( Microsoft.SPOT.Bitmap screen, IProvideNotifications notificationProvider, Microsoft.SPOT.Font font ) : void
Drawing ( Microsoft.SPOT.Bitmap screen = null ) : System
FillArea ( Microsoft.SPOT.Bitmap screen, System.Color color, Point point ) : void

This method fills an area which surrounded by line(s). Not only polygon but also circle, pentagram, cloud shaped... any figure. Only you need to fill is set Bitmap, Color, certain X and Y to argument. Both X and Y should be exist inner line(s).

FindCenter ( string text, Microsoft.SPOT.Font font ) : Point

Find the center of the screen, for the given text and font

HourHandLocation ( int hour, int minute ) : Point

Determin the hour hand point

MeasureString ( string text, Microsoft.SPOT.Font font ) : int

Measure the width that a set of text will take for a given font

MinuteHandLocation ( int minute, int second ) : Point

Determine where the outer point for the minute hand would be

PaintHands ( Microsoft.SPOT.Bitmap screen, System.Color foreColor, int hourWidth, int minuteWidth, int secondWidth, int hour, int minute, int second ) : void

Paint all hands, a 0 width will not force the hand to not print.

PaintHourHand ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, int hour, int minute ) : void

Paint the hour hand, with a given thickness

PaintLine ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, Point start, Point end ) : void

Paint a line from two points

PaintMinuteHand ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, int minute, int second ) : void

Paint the minute hand, with a given thickness

PaintSecondHand ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, int second ) : void

Paint the seconds hand, with a given thickness

PaintSkinnyHands ( Microsoft.SPOT.Bitmap screen, System.DateTime time, Point center ) : void
SecondHandLocation ( int second ) : Point

Determine determine the seconds hand point location

Private Methods

Method Description
PointOnCircle ( float radius, float angleInDegrees, Point origin ) : Point
_DrawUnfilledPoly ( Microsoft.SPOT.Bitmap screen, Point points, System.Color borderColor, short borderWidth, Point basePoint ) : void

Method Details

DrawAlignedText() public method

Draw text in a vertical and horizontal position When "align" is "Center" then "margin" is ignored. Also when "vAlign" is "Middle" then "vMargin" is ignored.
public DrawAlignedText ( Microsoft.SPOT.Bitmap screen, System.Color color, Microsoft.SPOT.Font font, string inString, HAlign align, int margin, VAlign vAlign, int vMargin ) : void
screen Microsoft.SPOT.Bitmap
color System.Color
font Microsoft.SPOT.Font
inString string
align HAlign
margin int
vAlign VAlign
vMargin int
return void

DrawBattery() public method

Draw a simple battery to the screen
public DrawBattery ( Microsoft.SPOT.Bitmap screen, Point batteryPosition, int batteryWidth, int batteryHeight, int borderThickness, System.Color batteryColor, System.Color backColor, bool charging, int batteryLevel ) : Size
screen Microsoft.SPOT.Bitmap
batteryPosition Point
batteryWidth int
batteryHeight int
borderThickness int
batteryColor System.Color
backColor System.Color
charging bool
batteryLevel int
return Size

DrawImageAtPoint() public method

Draw an image at a specific points
public DrawImageAtPoint ( Microsoft.SPOT.Bitmap screen, byte imageData, Microsoft.SPOT.Bitmap imageType, Point point ) : void
screen Microsoft.SPOT.Bitmap
imageData byte
imageType Microsoft.SPOT.Bitmap
point Point
return void

DrawImageCentered() public method

Draw an image centered
public DrawImageCentered ( Microsoft.SPOT.Bitmap screen, byte imageData, Microsoft.SPOT.Bitmap imageType ) : void
screen Microsoft.SPOT.Bitmap
imageData byte
imageType Microsoft.SPOT.Bitmap
return void

DrawPoly() public method

Draws polygon from list of points and fill it with specififed pattern.
public DrawPoly ( Microsoft.SPOT.Bitmap screen, Point points, System.Color borderColor, short borderWidth, System.Color fillColor, PolyFill polyFill ) : void
screen Microsoft.SPOT.Bitmap Bitmap to draw on
points Point Array of points defining polygon
borderColor System.Color Color of poly border
borderWidth short Poly border width
fillColor System.Color Color to use to fill poly
polyFill PolyFill Fill patern. Empty will simply draw unfilled poly
return void

DrawTextCentered() public method

Draw text right in the center of the screen
public DrawTextCentered ( Microsoft.SPOT.Bitmap screen, string text, Microsoft.SPOT.Font font, System.Color color ) : void
screen Microsoft.SPOT.Bitmap
text string
font Microsoft.SPOT.Font
color System.Color
return void

DrawTray() public method

public DrawTray ( Microsoft.SPOT.Bitmap screen, IProvideNotifications notificationProvider, Microsoft.SPOT.Font font ) : void
screen Microsoft.SPOT.Bitmap
notificationProvider IProvideNotifications
font Microsoft.SPOT.Font
return void

Drawing() public method

public Drawing ( Microsoft.SPOT.Bitmap screen = null ) : System
screen Microsoft.SPOT.Bitmap
return System

FillArea() public method

This method fills an area which surrounded by line(s). Not only polygon but also circle, pentagram, cloud shaped... any figure. Only you need to fill is set Bitmap, Color, certain X and Y to argument. Both X and Y should be exist inner line(s).
public FillArea ( Microsoft.SPOT.Bitmap screen, System.Color color, Point point ) : void
screen Microsoft.SPOT.Bitmap
color System.Color
point Point
return void

FindCenter() public method

Find the center of the screen, for the given text and font
public FindCenter ( string text, Microsoft.SPOT.Font font ) : Point
text string
font Microsoft.SPOT.Font
return Point

HourHandLocation() public method

Determin the hour hand point
public HourHandLocation ( int hour, int minute ) : Point
hour int
minute int
return Point

MeasureString() public method

Measure the width that a set of text will take for a given font
public MeasureString ( string text, Microsoft.SPOT.Font font ) : int
text string
font Microsoft.SPOT.Font
return int

MinuteHandLocation() public method

Determine where the outer point for the minute hand would be
public MinuteHandLocation ( int minute, int second ) : Point
minute int
second int
return Point

PaintHands() public method

Paint all hands, a 0 width will not force the hand to not print.
public PaintHands ( Microsoft.SPOT.Bitmap screen, System.Color foreColor, int hourWidth, int minuteWidth, int secondWidth, int hour, int minute, int second ) : void
screen Microsoft.SPOT.Bitmap
foreColor System.Color
hourWidth int
minuteWidth int
secondWidth int
hour int
minute int
second int
return void

PaintHourHand() public method

Paint the hour hand, with a given thickness
public PaintHourHand ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, int hour, int minute ) : void
screen Microsoft.SPOT.Bitmap
color System.Color
thickness int
hour int
minute int
return void

PaintLine() public method

Paint a line from two points
public PaintLine ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, Point start, Point end ) : void
screen Microsoft.SPOT.Bitmap
color System.Color
thickness int
start Point
end Point
return void

PaintMinuteHand() public method

Paint the minute hand, with a given thickness
public PaintMinuteHand ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, int minute, int second ) : void
screen Microsoft.SPOT.Bitmap
color System.Color
thickness int
minute int
second int
return void

PaintSecondHand() public method

Paint the seconds hand, with a given thickness
public PaintSecondHand ( Microsoft.SPOT.Bitmap screen, System.Color color, int thickness, int second ) : void
screen Microsoft.SPOT.Bitmap
color System.Color
thickness int
second int
return void

PaintSkinnyHands() public method

public PaintSkinnyHands ( Microsoft.SPOT.Bitmap screen, System.DateTime time, Point center ) : void
screen Microsoft.SPOT.Bitmap
time System.DateTime
center Point
return void

SecondHandLocation() public method

Determine determine the seconds hand point location
public SecondHandLocation ( int second ) : Point
second int
return Point