C# Класс AGENT.Contrib.Drawing.Drawing

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
PointOnCircle ( float radius, float angleInDegrees, Point origin ) : Point
_DrawUnfilledPoly ( Microsoft.SPOT.Bitmap screen, Point points, System.Color borderColor, short borderWidth, Point basePoint ) : void

Описание методов

DrawAlignedText() публичный Метод

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
Результат void

DrawBattery() публичный Метод

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
Результат Size

DrawImageAtPoint() публичный Метод

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
Результат void

DrawImageCentered() публичный Метод

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
Результат void

DrawPoly() публичный Метод

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
Результат void

DrawTextCentered() публичный Метод

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
Результат void

DrawTray() публичный Метод

public DrawTray ( Microsoft.SPOT.Bitmap screen, IProvideNotifications notificationProvider, Microsoft.SPOT.Font font ) : void
screen Microsoft.SPOT.Bitmap
notificationProvider IProvideNotifications
font Microsoft.SPOT.Font
Результат void

Drawing() публичный Метод

public Drawing ( Microsoft.SPOT.Bitmap screen = null ) : System
screen Microsoft.SPOT.Bitmap
Результат System

FillArea() публичный Метод

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
Результат void

FindCenter() публичный Метод

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
Результат Point

HourHandLocation() публичный Метод

Determin the hour hand point
public HourHandLocation ( int hour, int minute ) : Point
hour int
minute int
Результат Point

MeasureString() публичный Метод

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
Результат int

MinuteHandLocation() публичный Метод

Determine where the outer point for the minute hand would be
public MinuteHandLocation ( int minute, int second ) : Point
minute int
second int
Результат Point

PaintHands() публичный Метод

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
Результат void

PaintHourHand() публичный Метод

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
Результат void

PaintLine() публичный Метод

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
Результат void

PaintMinuteHand() публичный Метод

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
Результат void

PaintSecondHand() публичный Метод

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
Результат void

PaintSkinnyHands() публичный Метод

public PaintSkinnyHands ( Microsoft.SPOT.Bitmap screen, System.DateTime time, Point center ) : void
screen Microsoft.SPOT.Bitmap
time System.DateTime
center Point
Результат void

SecondHandLocation() публичный Метод

Determine determine the seconds hand point location
public SecondHandLocation ( int second ) : Point
second int
Результат Point