Graphics Class
Namespace: System.Drawing · Assembly: GHIElectronics.TinyCLR.Drawing
2-D drawing surface backed by a Bitmap. Issue line, rectangle, ellipse, text, and image draws against this surface, then push the result to the display via Flush(IntPtr).
public class Graphics : MarshalByRefObject, IDisposable
Properties
Width
public int Width { get; }
Column width in pixels. (inherited)
Height
public int Height { get; }
Frame height in pixels. (inherited)
PageUnit
public GraphicsUnit PageUnit { get; }
No description available.
Methods
GetPixel(int x, int y)
public uint GetPixel(int x, int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int |
Returns uint
SetPixel(int x, int y, Color color)
public void SetPixel(int x, int y, Color color)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int | |
color | Color |
GetBitmap()
public byte[] GetBitmap()
No description available.
Returns byte[]
GetBitmap(int x, int y, int width, int height)
public byte[] GetBitmap(int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int | |
width | int | |
height | int |
Returns byte[]
Dispose()
public void Dispose()
Releases buffered memory (the unmanaged firmware/application buffers). (inherited)
MeasureString(string text, Font font)
public SizeF MeasureString(string text, Font font)
No description available.
| Parameter | Type | Description |
|---|---|---|
text | string | |
font | Font |
Returns SizeF
MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
public SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
No description available.
| Parameter | Type | Description |
|---|---|---|
text | string | |
font | Font | |
layoutArea | SizeF | |
stringFormat | StringFormat |
Returns SizeF
Clear()
public void Clear()
Removes all elements from the UIElementCollection. (inherited)
FromHdc(IntPtr hdc)
public static Graphics FromHdc(IntPtr hdc)
No description available.
| Parameter | Type | Description |
|---|---|---|
hdc | IntPtr |
Returns Graphics
FromImage(Image image)
public static Graphics FromImage(Image image)
No description available.
| Parameter | Type | Description |
|---|---|---|
image | Image |
Returns Graphics
Flush()
public void Flush()
Writes unwritten data to the file. (inherited)
DrawImage(Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
public void DrawImage(Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
No description available.
| Parameter | Type | Description |
|---|---|---|
image | Image | |
x | int | |
y | int | |
srcRect | Rectangle | |
srcUnit | GraphicsUnit |
DrawImage(Image image, int x, int y, int width, int height)
public void DrawImage(Image image, int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
image | Image | |
x | int | |
y | int | |
width | int | |
height | int |
DrawImage(Image image, int x, int y)
public void DrawImage(Image image, int x, int y)
No description available.
| Parameter | Type | Description |
|---|---|---|
image | Image | |
x | int | |
y | int |
DrawImage(Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
public void DrawImage(Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
No description available.
| Parameter | Type | Description |
|---|---|---|
image | Image | |
destRect | Rectangle | |
srcRect | Rectangle | |
srcUnit | GraphicsUnit |
DrawLine(Pen pen, int x1, int y1, int x2, int y2)
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
No description available.
| Parameter | Type | Description |
|---|---|---|
pen | Pen | |
x1 | int | |
y1 | int | |
x2 | int | |
y2 | int |
DrawString(string s, Font font, Brush brush, float x, float y)
public void DrawString(string s, Font font, Brush brush, float x, float y)
No description available.
| Parameter | Type | Description |
|---|---|---|
s | string | |
font | Font | |
brush | Brush | |
x | float | |
y | float |
DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle)
No description available.
| Parameter | Type | Description |
|---|---|---|
s | string | |
font | Font | |
brush | Brush | |
layoutRectangle | RectangleF |
DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
public void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
No description available.
| Parameter | Type | Description |
|---|---|---|
s | string | |
font | Font | |
brush | Brush | |
layoutRectangle | RectangleF | |
format | StringFormat |
DrawEllipse(Pen pen, int x, int y, int width, int height)
public void DrawEllipse(Pen pen, int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
pen | Pen | |
x | int | |
y | int | |
width | int | |
height | int |
DrawRectangle(Pen pen, int x, int y, int width, int height)
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
pen | Pen | |
x | int | |
y | int | |
width | int | |
height | int |
FillEllipse(Brush brush, int x, int y, int width, int height)
public void FillEllipse(Brush brush, int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
brush | Brush | |
x | int | |
y | int | |
width | int | |
height | int |
FillRectangle(Brush brush, int x, int y, int width, int height)
public void FillRectangle(Brush brush, int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
brush | Brush | |
x | int | |
y | int | |
width | int | |
height | int |
DrawImage(int xDst, int yDst, Image image, int xSrc, int ySrc, int width, int height, ushort opacity)
public void DrawImage(int xDst, int yDst, Image image, int xSrc, int ySrc, int width, int height, ushort opacity)
No description available.
| Parameter | Type | Description |
|---|---|---|
xDst | int | |
yDst | int | |
image | Image | |
xSrc | int | |
ySrc | int | |
width | int | |
height | int | |
opacity | ushort |
Flush(int x, int y, int width, int height)
public void Flush(int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int | |
width | int | |
height | int |
SetClippingRectangle(int x, int y, int width, int height)
public void SetClippingRectangle(int x, int y, int width, int height)
No description available.
| Parameter | Type | Description |
|---|---|---|
x | int | |
y | int | |
width | int | |
height | int |
DrawTextInRect(string text, int x, int y, int width, int height, DrawTextAlignment dtFlags, Color color, Font font)
public void DrawTextInRect(string text, int x, int y, int width, int height, DrawTextAlignment dtFlags, Color color, Font font)
No description available.
| Parameter | Type | Description |
|---|---|---|
text | string | |
x | int | |
y | int | |
width | int | |
height | int | |
dtFlags | DrawTextAlignment | |
color | Color | |
font | Font |
DrawTextInRect(ref string text, ref int xRelStart, ref int yRelStart, int x, int y, int width, int height, DrawTextAlignment dtFlags, Color color, Font font)
public bool DrawTextInRect(ref string text, ref int xRelStart, ref int yRelStart, int x, int y, int width, int height, DrawTextAlignment dtFlags, Color color, Font font)
No description available.
| Parameter | Type | Description |
|---|---|---|
text | ref string | |
xRelStart | ref int | |
yRelStart | ref int | |
x | int | |
y | int | |
width | int | |
height | int | |
dtFlags | DrawTextAlignment | |
color | Color | |
font | Font |
Returns bool
RotateImage(int angle, int xDst, int yDst, Image image, int xSrc, int ySrc, int width, int height, ushort opacity)
public void RotateImage(int angle, int xDst, int yDst, Image image, int xSrc, int ySrc, int width, int height, ushort opacity)
No description available.
| Parameter | Type | Description |
|---|---|---|
angle | int | |
xDst | int | |
yDst | int | |
image | Image | |
xSrc | int | |
ySrc | int | |
width | int | |
height | int | |
opacity | ushort |
MakeTransparent(Color color)
public void MakeTransparent(Color color)
No description available.
| Parameter | Type | Description |
|---|---|---|
color | Color |
StretchImage(int xDst, int yDst, int widthDst, int heightDst, Image image, int xSrc, int ySrc, int widthSrc, int heightSrc, ushort opacity)
public void StretchImage(int xDst, int yDst, int widthDst, int heightDst, Image image, int xSrc, int ySrc, int widthSrc, int heightSrc, ushort opacity)
No description available.
| Parameter | Type | Description |
|---|---|---|
xDst | int | |
yDst | int | |
widthDst | int | |
heightDst | int | |
image | Image | |
xSrc | int | |
ySrc | int | |
widthSrc | int | |
heightSrc | int | |
opacity | ushort |
TileImage(int xDst, int yDst, Image image, int width, int height, ushort opacity)
public void TileImage(int xDst, int yDst, Image image, int width, int height, ushort opacity)
No description available.
| Parameter | Type | Description |
|---|---|---|
xDst | int | |
yDst | int | |
image | Image | |
width | int | |
height | int | |
opacity | ushort |
Scale9Image(int xDst, int yDst, int widthDst, int heightDst, Image image, int leftBorder, int topBorder, int rightBorder, int bottomBorder, ushort opacity)
public void Scale9Image(int xDst, int yDst, int widthDst, int heightDst, Image image, int leftBorder, int topBorder, int rightBorder, int bottomBorder, ushort opacity)
No description available.
| Parameter | Type | Description |
|---|---|---|
xDst | int | |
yDst | int | |
widthDst | int | |
heightDst | int | |
image | Image | |
leftBorder | int | |
topBorder | int | |
rightBorder | int | |
bottomBorder | int | |
opacity | ushort |
Events
OnFlushEvent
static public event OnFlushHandler OnFlushEvent
No description available.