Class Graphics
Encapsulates a Direct2D drawing surface.
Implements
Inherited Members
Namespace: GameOverlay.Drawing
Assembly: GameOverlay.dll
Syntax
public class Graphics : IDisposable
Constructors
| Improve this Doc View SourceGraphics()
Initializes a new Graphics surface.
Declaration
public Graphics()
Graphics(IntPtr)
Initializes a new Graphics surface using a window handle.
Declaration
public Graphics(IntPtr windowHandle)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | windowHandle | A handle to the window used as a surface. |
Graphics(IntPtr, Int32, Int32)
Initializes a new Graphics surface using a window handle and its width and height.
Declaration
public Graphics(IntPtr windowHandle, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | windowHandle | A handle to the window used as a surface. |
Int32 | width | A value indicating the width of the surface. |
Int32 | height | A value indicating the height of the surface. |
Properties
| Improve this Doc View SourceFPS
Specifies the images per second in which this graphics device redraws.
Declaration
public int FPS { get; }
Property Value
Type | Description |
---|---|
Int32 |
Height
Gets or sets the width of this Graphics surface.
Declaration
public int Height { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
IsDrawing
Indicates whether this Graphics surface is currently drawing on a Scene.
Declaration
public bool IsDrawing { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsInitialized
Indicates whether this Graphics surface is initialized.
Declaration
public bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsResizing
Indicates whether this Graphics surface will change its size on the next Scene.
Declaration
public bool IsResizing { get; }
Property Value
Type | Description |
---|---|
Boolean |
MeasureFPS
Determines whether this Graphics device will measure the resulting frames per second.
Declaration
public bool MeasureFPS { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
PerPrimitiveAntiAliasing
Determines whether Anti-Aliasing for each primitive (Line, Rectangle, Circle, Geometry) is enabled.
Declaration
public bool PerPrimitiveAntiAliasing { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
TextAntiAliasing
Determines whether Anti-Aliasing for Text is enabled.
Declaration
public bool TextAntiAliasing { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
UseMultiThreadedFactories
Determines whether factories (Font, Geometry, Brush) will be used in a multi-threaded environment.
Declaration
public bool UseMultiThreadedFactories { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
VSync
Determines whether this Graphics surface will be locked to the monitors refresh rate.
Declaration
public bool VSync { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Width
Gets or sets the width of this Graphics surface.
Declaration
public int Width { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
WindowHandle
Gets or sets the window handle of the Graphics surface.
Declaration
public IntPtr WindowHandle { get; set; }
Property Value
Type | Description |
---|---|
IntPtr |
Methods
| Improve this Doc View SourceBeginScene()
Starts a new Scene (Frame).
Declaration
public void BeginScene()
ClearScene()
Clears the current Scene (Frame) using a transparent background color.
Declaration
public void ClearScene()
ClearScene(Color)
Clears the current Scene (Frame) using the given background color.
Declaration
public void ClearScene(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The background color of this Scene. |
ClearScene(SolidBrush)
Clears the current Scene (Frame) using the given brush.
Declaration
public void ClearScene(SolidBrush brush)
Parameters
Type | Name | Description |
---|---|---|
SolidBrush | brush | The brush used to draw the background of this Scene. |
ClipRegionEnd()
Removes the last clip from the render target. After this method is called, the clip is no longer applied to subsequent drawing operations.
Declaration
public void ClipRegionEnd()
ClipRegionStart(Rectangle)
Specifies a rectangle to which all subsequent drawing operations are clipped.
Declaration
public void ClipRegionStart(Rectangle region)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | region | A Rectangle representing the size and position of the clipping area. |
ClipRegionStart(Single, Single, Single, Single)
Specifies a rectangle to which all subsequent drawing operations are clipped.
Declaration
public void ClipRegionStart(float left, float top, float right, float bottom)
Parameters
Type | Name | Description |
---|---|---|
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
CreateFont(String, Single, Boolean, Boolean, Boolean)
Creates a new Font by using the given font family, size and styles.
Declaration
public Font CreateFont(string fontFamilyName, float size, bool bold = false, bool italic = false, bool wordWrapping = false)
Parameters
Type | Name | Description |
---|---|---|
String | fontFamilyName | The name of any installed font family. |
Single | size | A value indicating the size of a font in pixels. |
Boolean | bold | A Boolean determining whether this font is bold. |
Boolean | italic | A Boolean determining whether this font is italic. |
Boolean | wordWrapping | A Boolean determining whether this font uses word wrapping. |
Returns
Type | Description |
---|---|
Font |
CreateGeometry()
Creates a new Geometry used to draw complex figures.
Declaration
public Geometry CreateGeometry()
Returns
Type | Description |
---|---|
Geometry | The Geometry this method creates. |
CreateImage(Byte[])
Creates a new Image by using the given bytes.
Declaration
public Image CreateImage(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | An image loaded into a byte array. |
Returns
Type | Description |
---|---|
Image | The Image this method creates. |
CreateImage(String)
Creates a new Image from an image file on the disk.
Declaration
public Image CreateImage(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to an image file. |
Returns
Type | Description |
---|---|
Image | The Image this method creates. |
CreateSolidBrush(Color)
Creates a new SolidBrush by using the given color structure.
Declaration
public SolidBrush CreateSolidBrush(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | A value representing the ARGB components used to create a SolidBrush. |
Returns
Type | Description |
---|---|
SolidBrush | The SolidBrush this method creates. |
CreateSolidBrush(Int32, Int32, Int32, Int32)
Creates a new SolidBrush by using the given color components.
Declaration
public SolidBrush CreateSolidBrush(int r, int g, int b, int a = 255)
Parameters
Type | Name | Description |
---|---|---|
Int32 | r | The red component value of this color. |
Int32 | g | The green component value of this color. |
Int32 | b | The blue component value of this color. |
Int32 | a | The alpha component value of this color. |
Returns
Type | Description |
---|---|
SolidBrush | The SolidBrush this method creates. |
CreateSolidBrush(Single, Single, Single, Single)
Creates a new SolidBrush by using the given color components.
Declaration
public SolidBrush CreateSolidBrush(float r, float g, float b, float a = 1F)
Parameters
Type | Name | Description |
---|---|---|
Single | r | The red component value of this color. |
Single | g | The green component value of this color. |
Single | b | The blue component value of this color. |
Single | a | The alpha component value of this color. |
Returns
Type | Description |
---|---|
SolidBrush | The SolidBrush this method creates. |
DashedCircle(IBrush, Circle, Single)
Draws a circle with a dashed line by using the given brush and dimension.
Declaration
public void DashedCircle(IBrush brush, Circle circle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Circle | circle | A Circle structure which includes the dimension of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
DashedCircle(IBrush, Point, Single, Single)
Draws a circle with a dashed line by using the given brush and dimension.
Declaration
public void DashedCircle(IBrush brush, Point location, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
DashedCircle(IBrush, Single, Single, Single, Single)
Draws a circle with a dashed line by using the given brush and dimension.
Declaration
public void DashedCircle(IBrush brush, float x, float y, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Single | x | The x-coordinate of the center of the circle. |
Single | y | The y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
DashedEllipse(IBrush, Ellipse, Single)
Draws an ellipse with a dashed line by using the given brush and dimension.
Declaration
public void DashedEllipse(IBrush brush, Ellipse ellipse, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Ellipse | ellipse | An Ellipse structure which includes the dimension of the ellipse. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
DashedEllipse(IBrush, Point, Single, Single, Single)
Draws an ellipse with a dashed line by using the given brush and dimension.
Declaration
public void DashedEllipse(IBrush brush, Point location, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
DashedEllipse(IBrush, Single, Single, Single, Single, Single)
Draws an ellipse with a dashed line by using the given brush and dimension.
Declaration
public void DashedEllipse(IBrush brush, float x, float y, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Single | x | The x-coordinate of the center of the ellipse. |
Single | y | The y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
DashedGeometry(Geometry, IBrush, Single)
Draws a Geometry with dashed lines using the given brush and thickness.
Declaration
public void DashedGeometry(Geometry geometry, IBrush brush, float stroke)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | The Geometry to be drawn. |
IBrush | brush | A brush that determines the color of the text. |
Single | stroke | A value that determines the width/thickness of the lines. |
DashedLine(IBrush, Line, Single)
Draws a dashed line at the given start and end point.
Declaration
public void DashedLine(IBrush brush, Line line, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the line. |
Line | line | A Line structure including the start and end Point of the line. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedLine(IBrush, Point, Point, Single)
Draws a dashed line at the given start and end point.
Declaration
public void DashedLine(IBrush brush, Point start, Point end, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the line. |
Point | start | A Point structure including the start position of the line. |
Point | end | A Point structure including the end position of the line. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedLine(IBrush, Single, Single, Single, Single, Single)
Draws a dashed line at the given start and end point.
Declaration
public void DashedLine(IBrush brush, float startX, float startY, float endX, float endY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the line. |
Single | startX | The start position of the line on the x-axis |
Single | startY | The start position of the line on the y-axis |
Single | endX | The end position of the line on the x-axis |
Single | endY | The end position of the line on the y-axis |
Single | stroke | A value that determines the width/thickness of the line. |
DashedRectangle(IBrush, Rectangle, Single)
Draws a rectangle with dashed lines by using the given brush and dimension.
Declaration
public void DashedRectangle(IBrush brush, Rectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Rectangle | rectangle | A Rectangle structure that determines the boundaries of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedRectangle(IBrush, Single, Single, Single, Single, Single)
Draws a rectangle with dashed lines by using the given brush and dimension.
Declaration
public void DashedRectangle(IBrush brush, float left, float top, float right, float bottom, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedRoundedRectangle(IBrush, RoundedRectangle, Single)
Draws a rectangle with rounded edges and dashed lines by using the given brush and dimension.
Declaration
public void DashedRoundedRectangle(IBrush brush, RoundedRectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
RoundedRectangle | rectangle | A RoundedRectangle structure including the dimension of the rounded rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedRoundedRectangle(IBrush, Single, Single, Single, Single, Single, Single)
Draws a rectangle with rounded edges and dashed lines by using the given brush and dimension.
Declaration
public void DashedRoundedRectangle(IBrush brush, float left, float top, float right, float bottom, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | radius | A value that determines radius of corners. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedTriangle(IBrush, Point, Point, Point, Single)
Draws a triangle with dashed lines using the given brush and dimension.
Declaration
public void DashedTriangle(IBrush brush, Point a, Point b, Point c, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Point | a | A Point structure including the coordinates of the lower-left corner of the triangle. |
Point | b | A Point structure including the coordinates of the lower-right corner of the triangle. |
Point | c | A Point structure including the coordinates of the upper-center corner of the triangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedTriangle(IBrush, Triangle, Single)
Draws a triangle with dashed lines using the given brush and dimension.
Declaration
public void DashedTriangle(IBrush brush, Triangle triangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Triangle | triangle | A Triangle structure including the dimension of the triangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DashedTriangle(IBrush, Single, Single, Single, Single, Single, Single, Single)
Draws a triangle with dashed lines using the given brush and dimension.
Declaration
public void DashedTriangle(IBrush brush, float aX, float aY, float bX, float bY, float cX, float cY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Single | aX | The x-coordinate lower-left corner of the triangle. |
Single | aY | The y-coordinate lower-left corner of the triangle. |
Single | bX | The x-coordinate lower-right corner of the triangle. |
Single | bY | The y-coordinate lower-right corner of the triangle. |
Single | cX | The x-coordinate upper-center corner of the triangle. |
Single | cY | The y-coordinate upper-center corner of the triangle. |
Single | stroke | A value that determines the width/thickness of the line. |
Destroy()
Destroys an already initialized Graphics surface and frees its resources.
Declaration
public void Destroy()
Dispose()
Releases all resources used by this Graphics surface.
Declaration
public void Dispose()
Dispose(Boolean)
Releases all resources used by this Graphics surface.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | A Boolean value indicating whether this is called from the destructor. |
DrawArrowLine(IBrush, Line, Single)
Draws a pointed line using the given brush and dimension.
Declaration
public void DrawArrowLine(IBrush brush, Line line, float size)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the arrow line. |
Line | line | A Line structure including the start (direction) and end point of the arrow line. |
Single | size | A value determining the size of the arrow line. |
DrawArrowLine(IBrush, Point, Point, Single)
Draws a pointed line using the given brush and dimension.
Declaration
public void DrawArrowLine(IBrush brush, Point start, Point end, float size)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the arrow line. |
Point | start | A Point structure including the start position of the arrow line. (the direction it points to) |
Point | end | A Point structure including the end position of the arrow line. (the direction it points to) |
Single | size | A value determining the size of the arrow line. |
DrawArrowLine(IBrush, Single, Single, Single, Single, Single)
Draws a pointed line using the given brush and dimension.
Declaration
public void DrawArrowLine(IBrush brush, float startX, float startY, float endX, float endY, float size)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the arrow line. |
Single | startX | The x-coordinate of the start of the arrow line. (the direction it points to) |
Single | startY | The y-coordinate of the start of the arrow line. (the direction it points to) |
Single | endX | The x-coordinate of the end of the arrow line. |
Single | endY | The y-coordinate of the end of the arrow line. |
Single | size | A value determining the size of the arrow line. |
DrawBox2D(IBrush, IBrush, Rectangle, Single)
Draws a 2D Box with an outline using the given brush and dimension.
Declaration
public void DrawBox2D(IBrush outline, IBrush fill, Rectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the rectangle. |
Rectangle | rectangle | A Rectangle structure including the dimension of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawBox2D(IBrush, IBrush, Single, Single, Single, Single, Single)
Draws a 2D Box with an outline using the given brush and dimension.
Declaration
public void DrawBox2D(IBrush outline, IBrush fill, float left, float top, float right, float bottom, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawCircle(IBrush, Circle, Single)
Draws a circle using the given brush and dimension.
Declaration
public void DrawCircle(IBrush brush, Circle circle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Circle | circle | A Circle structure which includes the dimension of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
DrawCircle(IBrush, Point, Single, Single)
Draws a circle using the given brush and dimension.
Declaration
public void DrawCircle(IBrush brush, Point location, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
DrawCircle(IBrush, Single, Single, Single, Single)
Draws a circle using the given brush and dimension.
Declaration
public void DrawCircle(IBrush brush, float x, float y, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Single | x | The x-coordinate of the center of the circle. |
Single | y | The y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
DrawCrosshair(IBrush, Point, Single, Single, CrosshairStyle)
Draws a crosshair by using the given brush and style.
Declaration
public void DrawCrosshair(IBrush brush, Point location, float size, float stroke, CrosshairStyle style)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the crosshair. |
Point | location | A Location structure including the position of the crosshair. |
Single | size | The size of the crosshair in pixels. |
Single | stroke | A value that determines the width/thickness of the line. |
CrosshairStyle | style | A value that determines the appearance of the crosshair. |
DrawCrosshair(IBrush, Single, Single, Single, Single, CrosshairStyle)
Draws a crosshair by using the given brush and style.
Declaration
public void DrawCrosshair(IBrush brush, float x, float y, float size, float stroke, CrosshairStyle style)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the crosshair. |
Single | x | The x-coordinate of the center of the crosshair. |
Single | y | The y-coordinate of the center of the crosshair. |
Single | size | The size of the crosshair in pixels. |
Single | stroke | A value that determines the width/thickness of the line. |
CrosshairStyle | style | A value that determines the appearance of the crosshair. |
DrawEllipse(IBrush, Ellipse, Single)
Draws an ellipse by using the given brush and dimension.
Declaration
public void DrawEllipse(IBrush brush, Ellipse ellipse, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Ellipse | ellipse | An Ellipse structure which includes the dimension of the ellipse. |
Single | stroke | A value that determines the width/thickness of the circle. |
DrawEllipse(IBrush, Point, Single, Single, Single)
Draws an ellipse by using the given brush and dimension.
Declaration
public void DrawEllipse(IBrush brush, Point location, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of this ellipse on the x-axis. |
Single | radiusY | The radius of this ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the circle. |
DrawEllipse(IBrush, Single, Single, Single, Single, Single)
Draws an ellipse by using the given brush and dimension.
Declaration
public void DrawEllipse(IBrush brush, float x, float y, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Single | x | The x-coordinate of the center of the ellipse. |
Single | y | The y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of this ellipse on the x-axis. |
Single | radiusY | The radius of this ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the circle. |
DrawGeometry(Geometry, IBrush, Single)
Draws a Geometry using the given brush and thickness.
Declaration
public void DrawGeometry(Geometry geometry, IBrush brush, float stroke)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | The Geometry to be drawn. |
IBrush | brush | A brush that determines the color of the text. |
Single | stroke | A value that determines the width/thickness of the lines. |
DrawHorizontalProgressBar(IBrush, IBrush, Rectangle, Single, Single)
Draws a horizontal progrss bar using the given brush, dimension and percentage value.
Declaration
public void DrawHorizontalProgressBar(IBrush outline, IBrush fill, Rectangle rectangle, float stroke, float percentage)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the progress bar. |
Rectangle | rectangle | A Rectangle structure including the dimension of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
Single | percentage | A value indicating the progress in percent. |
DrawHorizontalProgressBar(IBrush, IBrush, Single, Single, Single, Single, Single, Single)
Draws a horizontal progrss bar using the given brush, dimension and percentage value.
Declaration
public void DrawHorizontalProgressBar(IBrush outline, IBrush fill, float left, float top, float right, float bottom, float stroke, float percentage)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the progress bar. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
Single | percentage | A value indicating the progress in percent. |
DrawImage(Image, Point, Single)
Draws an image to the given position and optional applies an alpha value.
Declaration
public void DrawImage(Image image, Point location, float opacity = 1F)
Parameters
Type | Name | Description |
---|---|---|
Image | image | The Image to be drawn. |
Point | location | A Point structure inclduing the position of the upper-left corner of the image. |
Single | opacity | A value indicating the opacity of the image. (alpha) |
DrawImage(Image, Rectangle, Single, Boolean)
Draws an image to the given position, scales it and optional applies an alpha value.
Declaration
public void DrawImage(Image image, Rectangle rectangle, float opacity = 1F, bool linearScale = true)
Parameters
Type | Name | Description |
---|---|---|
Image | image | The Image to be drawn. |
Rectangle | rectangle | A Rectangle structure inclduing the dimension of the image. |
Single | opacity | A value indicating the opacity of the image. (alpha) |
Boolean | linearScale | A Boolean indicating whether linear scaling should be applied |
DrawImage(Image, Single, Single, Single)
Draws an image to the given position and optional applies an alpha value.
Declaration
public void DrawImage(Image image, float x, float y, float opacity = 1F)
Parameters
Type | Name | Description |
---|---|---|
Image | image | The Image to be drawn. |
Single | x | The x-coordinate upper-left corner of the image. |
Single | y | The y-coordinate upper-left corner of the image. |
Single | opacity | A value indicating the opacity of the image. (alpha) |
DrawImage(Image, Single, Single, Single, Single, Single, Boolean)
Draws an image to the given position, scales it and optional applies an alpha value.
Declaration
public void DrawImage(Image image, float left, float top, float right, float bottom, float opacity = 1F, bool linearScale = true)
Parameters
Type | Name | Description |
---|---|---|
Image | image | The Image to be drawn. |
Single | left | The x-coordinate of the upper-left corner of the image. |
Single | top | The y-coordinate of the upper-left corner of the image. |
Single | right | The x-coordinate of the lower-right corner of the image. |
Single | bottom | The y-coordinate of the lower-right corner of the image. |
Single | opacity | A value indicating the opacity of the image. (alpha) |
Boolean | linearScale | A Boolean indicating whether linear scaling should be applied |
DrawLine(IBrush, Line, Single)
Draws a line starting and ending at the given points.
Declaration
public void DrawLine(IBrush brush, Line line, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the line. |
Line | line | A Line structure including the start and end Point of the line. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawLine(IBrush, Point, Point, Single)
Draws a line starting and ending at the given points.
Declaration
public void DrawLine(IBrush brush, Point start, Point end, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the line. |
Point | start | A Point structure including the start position of the line. |
Point | end | A Point structure including the end position of the line. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawLine(IBrush, Single, Single, Single, Single, Single)
Draws a line starting and ending at the given points.
Declaration
public void DrawLine(IBrush brush, float startX, float startY, float endX, float endY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the line. |
Single | startX | The start position of the line on the x-axis |
Single | startY | The start position of the line on the y-axis |
Single | endX | The end position of the line on the x-axis |
Single | endY | The end position of the line on the y-axis |
Single | stroke | A value that determines the width/thickness of the line. |
DrawRectangle(IBrush, Rectangle, Single)
Draws a rectangle by using the given brush and dimension.
Declaration
public void DrawRectangle(IBrush brush, Rectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Rectangle | rectangle | A Rectangle structure that determines the boundaries of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawRectangle(IBrush, Single, Single, Single, Single, Single)
Draws a rectangle by using the given brush and dimension.
Declaration
public void DrawRectangle(IBrush brush, float left, float top, float right, float bottom, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawRectangleEdges(IBrush, Rectangle, Single)
Draws the corners (edges) of a rectangle using the given brush and dimension.
Declaration
public void DrawRectangleEdges(IBrush brush, Rectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Rectangle | rectangle | A Rectangle structure including the dimension of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawRectangleEdges(IBrush, Single, Single, Single, Single, Single)
Draws the corners (edges) of a rectangle using the given brush and dimension.
Declaration
public void DrawRectangleEdges(IBrush brush, float left, float top, float right, float bottom, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawRoundedRectangle(IBrush, RoundedRectangle, Single)
Draws a rectangle with rounded edges by using the given brush and dimension.
Declaration
public void DrawRoundedRectangle(IBrush brush, RoundedRectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
RoundedRectangle | rectangle | A RoundedRectangle structure including the dimension of the rounded rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawRoundedRectangle(IBrush, Single, Single, Single, Single, Single, Single)
Draws a rectangle with rounded edges by using the given brush and dimension.
Declaration
public void DrawRoundedRectangle(IBrush brush, float left, float top, float right, float bottom, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | radius | A value that determines radius of corners. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawText(Font, IBrush, Point, String)
Draws a string using the given font and position.
Declaration
public void DrawText(Font font, IBrush brush, Point location, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
IBrush | brush | A brush that determines the color of the text. |
Point | location | A Point structure including the starting position. |
String | text | The string to be drawn. |
DrawText(Font, IBrush, Single, Single, String)
Draws a string using the given font and position.
Declaration
public void DrawText(Font font, IBrush brush, float x, float y, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
IBrush | brush | A brush that determines the color of the text. |
Single | x | The x-coordinate of the starting position. |
Single | y | The y-coordinate of the starting position. |
String | text | The string to be drawn. |
DrawText(Font, Single, IBrush, Point, String)
Draws a string using the given font, size and position.
Declaration
public void DrawText(Font font, float fontSize, IBrush brush, Point location, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
Single | fontSize | The size of the Font. (does not need to be the same as in Font.FontSize) |
IBrush | brush | A brush that determines the color of the text. |
Point | location | A Point structure including the starting position. |
String | text | The string to be drawn. |
DrawText(Font, Single, IBrush, Single, Single, String)
Draws a string using the given font, size and position.
Declaration
public void DrawText(Font font, float fontSize, IBrush brush, float x, float y, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
Single | fontSize | The size of the Font. (does not need to be the same as in Font.FontSize) |
IBrush | brush | A brush that determines the color of the text. |
Single | x | The x-coordinate of the starting position. |
Single | y | The y-coordinate of the starting position. |
String | text | The string to be drawn. |
DrawTextWithBackground(Font, IBrush, IBrush, Point, String)
Draws a string with a background box in behind using the given font, size and position.
Declaration
public void DrawTextWithBackground(Font font, IBrush brush, IBrush background, Point location, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
IBrush | brush | A brush that determines the color of the text. |
IBrush | background | A brush that determines the color of the background box. |
Point | location | A Point structure including the starting position. |
String | text | The string to be drawn. |
DrawTextWithBackground(Font, IBrush, IBrush, Single, Single, String)
Draws a string with a background box in behind using the given font, size and position.
Declaration
public void DrawTextWithBackground(Font font, IBrush brush, IBrush background, float x, float y, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
IBrush | brush | A brush that determines the color of the text. |
IBrush | background | A brush that determines the color of the background box. |
Single | x | The x-coordinate of the starting position. |
Single | y | The y-coordinate of the starting position. |
String | text | The string to be drawn. |
DrawTextWithBackground(Font, Single, IBrush, IBrush, Point, String)
Draws a string with a background box in behind using the given font, size and position.
Declaration
public void DrawTextWithBackground(Font font, float fontSize, IBrush brush, IBrush background, Point location, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
Single | fontSize | The size of the Font. (does not need to be the same as in Font.FontSize) |
IBrush | brush | A brush that determines the color of the text. |
IBrush | background | A brush that determines the color of the background box. |
Point | location | A Point structure including the starting position. |
String | text | The string to be drawn. |
DrawTextWithBackground(Font, Single, IBrush, IBrush, Single, Single, String)
Draws a string with a background box in behind using the given font, size and position.
Declaration
public void DrawTextWithBackground(Font font, float fontSize, IBrush brush, IBrush background, float x, float y, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | The Font to be used to draw the string. |
Single | fontSize | The size of the Font. (does not need to be the same as in Font.FontSize) |
IBrush | brush | A brush that determines the color of the text. |
IBrush | background | A brush that determines the color of the background box. |
Single | x | The x-coordinate of the starting position. |
Single | y | The y-coordinate of the starting position. |
String | text | The string to be drawn. |
DrawTriangle(IBrush, Point, Point, Point, Single)
Draws a triangle using the given brush and dimension.
Declaration
public void DrawTriangle(IBrush brush, Point a, Point b, Point c, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Point | a | A Point structure including the coordinates of the lower-left corner of the triangle. |
Point | b | A Point structure including the coordinates of the lower-right corner of the triangle. |
Point | c | A Point structure including the coordinates of the upper-center corner of the triangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawTriangle(IBrush, Triangle, Single)
Draws a triangle using the given brush and dimension.
Declaration
public void DrawTriangle(IBrush brush, Triangle triangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Triangle | triangle | A Triangle structure including the dimension of the triangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawTriangle(IBrush, Single, Single, Single, Single, Single, Single, Single)
Draws a triangle using the given brush and dimension.
Declaration
public void DrawTriangle(IBrush brush, float aX, float aY, float bX, float bY, float cX, float cY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Single | aX | The x-coordinate lower-left corner of the triangle. |
Single | aY | The y-coordinate lower-left corner of the triangle. |
Single | bX | The x-coordinate lower-right corner of the triangle. |
Single | bY | The y-coordinate lower-right corner of the triangle. |
Single | cX | The x-coordinate upper-center corner of the triangle. |
Single | cY | The y-coordinate upper-center corner of the triangle. |
Single | stroke | A value that determines the width/thickness of the line. |
DrawVerticalProgressBar(IBrush, IBrush, Rectangle, Single, Single)
Draws a vertical progrss bar using the given brush, dimension and percentage value.
Declaration
public void DrawVerticalProgressBar(IBrush outline, IBrush fill, Rectangle rectangle, float stroke, float percentage)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the progress bar. |
Rectangle | rectangle | A Rectangle structure including the dimension of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
Single | percentage | A value indicating the progress in percent. |
DrawVerticalProgressBar(IBrush, IBrush, Single, Single, Single, Single, Single, Single)
Draws a vertical progrss bar using the given brush, dimension and percentage value.
Declaration
public void DrawVerticalProgressBar(IBrush outline, IBrush fill, float left, float top, float right, float bottom, float stroke, float percentage)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the progress bar. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
Single | percentage | A value indicating the progress in percent. |
EndScene()
Ends the current Scene (Frame).
Declaration
public void EndScene()
Equals(Graphics)
Returns a value indicating whether two specified instances of Graphics represent the same value.
Declaration
public bool Equals(Graphics value)
Parameters
Type | Name | Description |
---|---|---|
Graphics | value | An object to compare to this instance. |
Returns
Type | Description |
---|---|
Boolean | true if |
Equals(Graphics, Graphics)
Returns a value indicating whether two specified instances of Graphics represent the same value.
Declaration
public static bool Equals(Graphics left, Graphics right)
Parameters
Type | Name | Description |
---|---|---|
Graphics | left | The first object to compare. |
Graphics | right | The second object to compare. |
Returns
Type | Description |
---|---|
Boolean | true if |
Equals(Object)
Returns a value indicating whether this instance and a specified Object represent the same type and value.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
Boolean | true if |
Overrides
| Improve this Doc View SourceFillCircle(IBrush, Circle)
Fills a circle by using the given brush and dimesnion.
Declaration
public void FillCircle(IBrush brush, Circle circle)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Circle | circle | A Circle structure which includes the dimension of the circle. |
FillCircle(IBrush, Point, Single)
Fills a circle by using the given brush and dimesnion.
Declaration
public void FillCircle(IBrush brush, Point location, float radius)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
FillCircle(IBrush, Single, Single, Single)
Fills a circle by using the given brush and dimesnion.
Declaration
public void FillCircle(IBrush brush, float x, float y, float radius)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the circle. |
Single | x | The x-coordinate of the center of the circle. |
Single | y | The y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
FillEllipse(IBrush, Ellipse)
Fills an ellipse by using the given brush and dimesnion.
Declaration
public void FillEllipse(IBrush brush, Ellipse ellipse)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Ellipse | ellipse | An Ellipse structure which includes the dimension of the ellipse. |
FillEllipse(IBrush, Point, Single, Single)
Fills an ellipse by using the given brush and dimesnion.
Declaration
public void FillEllipse(IBrush brush, Point location, float radiusX, float radiusY)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
FillEllipse(IBrush, Single, Single, Single, Single)
Fills an ellipse by using the given brush and dimesnion.
Declaration
public void FillEllipse(IBrush brush, float x, float y, float radiusX, float radiusY)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the ellipse. |
Single | x | The x-coordinate of the center of the ellipse. |
Single | y | The y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
FillGeometry(Geometry, IBrush)
Fills the Geometry using the given brush.
Declaration
public void FillGeometry(Geometry geometry, IBrush brush)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry | The Geometry to be drawn. |
IBrush | brush | A brush that determines the color of the text. |
FillMesh(Mesh, IBrush)
Fills the Mesh using the given brush.
Declaration
public void FillMesh(Mesh mesh, IBrush brush)
Parameters
Type | Name | Description |
---|---|---|
SharpDX.Direct2D1.Mesh | mesh | The Mesh to be drawn. |
IBrush | brush | A brush that determines the color of the text. |
FillRectangle(IBrush, Rectangle)
Fills a rectangle by using the given brush and dimension.
Declaration
public void FillRectangle(IBrush brush, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Rectangle | rectangle | A Rectangle structure that determines the boundaries of the rectangle. |
FillRectangle(IBrush, Single, Single, Single, Single)
Fills a rectangle by using the given brush and dimension.
Declaration
public void FillRectangle(IBrush brush, float left, float top, float right, float bottom)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
FillRoundedRectangle(IBrush, RoundedRectangle)
Fills a rounded rectangle using the given brush and dimension.
Declaration
public void FillRoundedRectangle(IBrush brush, RoundedRectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
RoundedRectangle | rectangle | A RoundedRectangle structure including the dimension of the rounded rectangle. |
FillRoundedRectangle(IBrush, Single, Single, Single, Single, Single)
Fills a rounded rectangle using the given brush and dimension.
Declaration
public void FillRoundedRectangle(IBrush brush, float left, float top, float right, float bottom, float radius)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | radius | A value that determines radius of corners. |
FillTriangle(IBrush, Point, Point, Point)
Fills a triangle using the given brush and dimension.
Declaration
public void FillTriangle(IBrush brush, Point a, Point b, Point c)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Point | a | A Point structure including the coordinates of the lower-left corner of the triangle. |
Point | b | A Point structure including the coordinates of the lower-right corner of the triangle. |
Point | c | A Point structure including the coordinates of the upper-center corner of the triangle. |
FillTriangle(IBrush, Triangle)
Fills a triangle using the given brush and dimension.
Declaration
public void FillTriangle(IBrush brush, Triangle triangle)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Triangle | triangle | A Triangle structure including the dimension of the triangle. |
FillTriangle(IBrush, Single, Single, Single, Single, Single, Single)
Fills a triangle using the given brush and dimension.
Declaration
public void FillTriangle(IBrush brush, float aX, float aY, float bX, float bY, float cX, float cY)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | A brush that determines the color of the triangle. |
Single | aX | The x-coordinate lower-left corner of the triangle. |
Single | aY | The y-coordinate lower-left corner of the triangle. |
Single | bX | The x-coordinate lower-right corner of the triangle. |
Single | bY | The y-coordinate lower-right corner of the triangle. |
Single | cX | The x-coordinate upper-center corner of the triangle. |
Single | cY | The y-coordinate upper-center corner of the triangle. |
Finalize()
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
Declaration
protected void Finalize()
GetFactory()
Gets the Factory used by this Graphics surface.
Declaration
public Factory GetFactory()
Returns
Type | Description |
---|---|
SharpDX.Direct2D1.Factory | The Factory of this Graphics surface. |
GetFontFactory()
Gets the FontFactory used by this Graphics surface.
Declaration
public Factory GetFontFactory()
Returns
Type | Description |
---|---|
SharpDX.DirectWrite.Factory | The FontFactory of this Graphics surface. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer hash code. |
Overrides
| Improve this Doc View SourceGetRenderTarget()
Gets the RenderTarget used by this Graphics surface.
Declaration
public RenderTarget GetRenderTarget()
Returns
Type | Description |
---|---|
SharpDX.Direct2D1.RenderTarget | The RenderTarget of this Graphics surface. |
MeasureString(Font, Single, String)
Measures the specified string when drawn with the specified Font.
Declaration
public Point MeasureString(Font font, float fontSize, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | Font that defines the text format of the string. |
Single | fontSize | The size of the Font. (does not need to be the same as in Font.FontSize) |
String | text | String to measure. |
Returns
Type | Description |
---|---|
Point | This method returns a Point containing the width (x) and height (y) of the given text. |
MeasureString(Font, String)
Measures the specified string when drawn with the specified Font.
Declaration
public Point MeasureString(Font font, string text)
Parameters
Type | Name | Description |
---|---|---|
Font | font | Font that defines the text format of the string. |
String | text | String to measure. |
Returns
Type | Description |
---|---|
Point | This method returns a Point containing the width (x) and height (y) of the given text. |
OutlineCircle(IBrush, IBrush, Circle, Single)
Draws a circle with an outline around it using the given brush and dimension.
Declaration
public void OutlineCircle(IBrush outline, IBrush fill, Circle circle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the circle. |
Circle | circle | A Circle structure which includes the dimension of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
OutlineCircle(IBrush, IBrush, Point, Single, Single)
Draws a circle with an outline around it using the given brush and dimension.
Declaration
public void OutlineCircle(IBrush outline, IBrush fill, Point location, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the circle. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
OutlineCircle(IBrush, IBrush, Single, Single, Single, Single)
Draws a circle with an outline around it using the given brush and dimension.
Declaration
public void OutlineCircle(IBrush outline, IBrush fill, float x, float y, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the circle. |
Single | x | The x-coordinate of the center of the circle. |
Single | y | The y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
OutlineEllipse(IBrush, IBrush, Ellipse, Single)
Draws an ellipse with an outline around it using the given brush and dimension.
Declaration
public void OutlineEllipse(IBrush outline, IBrush fill, Ellipse ellipse, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the ellipse. |
Ellipse | ellipse | An Ellipse structure which includes the dimension of the ellipse. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
OutlineEllipse(IBrush, IBrush, Point, Single, Single, Single)
Draws an ellipse with an outline around it using the given brush and dimension.
Declaration
public void OutlineEllipse(IBrush outline, IBrush fill, Point location, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the ellipse. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
OutlineEllipse(IBrush, IBrush, Single, Single, Single, Single, Single)
Draws an ellipse with an outline around it using the given brush and dimension.
Declaration
public void OutlineEllipse(IBrush outline, IBrush fill, float x, float y, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the ellipse. |
Single | x | The x-coordinate of the center of the ellipse. |
Single | y | The y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
OutlineFillCircle(IBrush, IBrush, Circle, Single)
Draws a filled circle with an outline around it.
Declaration
public void OutlineFillCircle(IBrush outline, IBrush fill, Circle circle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the circle. |
Circle | circle | A Circle structure which includes the dimension of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
OutlineFillCircle(IBrush, IBrush, Point, Single, Single)
Draws a filled circle with an outline around it.
Declaration
public void OutlineFillCircle(IBrush outline, IBrush fill, Point location, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the circle. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
OutlineFillCircle(IBrush, IBrush, Single, Single, Single, Single)
Draws a filled circle with an outline around it.
Declaration
public void OutlineFillCircle(IBrush outline, IBrush fill, float x, float y, float radius, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the circle. |
Single | x | The x-coordinate of the center of the circle. |
Single | y | The y-coordinate of the center of the circle. |
Single | radius | The radius of the circle. |
Single | stroke | A value that determines the width/thickness of the circle. |
OutlineFillEllipse(IBrush, IBrush, Ellipse, Single)
Draws a filled ellipse with an outline around it.
Declaration
public void OutlineFillEllipse(IBrush outline, IBrush fill, Ellipse ellipse, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the ellipse. |
Ellipse | ellipse | An Ellipse structure which includes the dimension of the ellipse. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
OutlineFillEllipse(IBrush, IBrush, Point, Single, Single, Single)
Draws a filled ellipse with an outline around it.
Declaration
public void OutlineFillEllipse(IBrush outline, IBrush fill, Point location, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the ellipse. |
Point | location | A Point structureure which includes the x- and y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
OutlineFillEllipse(IBrush, IBrush, Single, Single, Single, Single, Single)
Draws a filled ellipse with an outline around it.
Declaration
public void OutlineFillEllipse(IBrush outline, IBrush fill, float x, float y, float radiusX, float radiusY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the ellipse. |
Single | x | The x-coordinate of the center of the ellipse. |
Single | y | The y-coordinate of the center of the ellipse. |
Single | radiusX | The radius of the ellipse on the x-axis. |
Single | radiusY | The radius of the ellipse on the y-axis. |
Single | stroke | A value that determines the width/thickness of the ellipse. |
OutlineFillRectangle(IBrush, IBrush, Rectangle, Single)
Draws a filled rectangle with an outline around it by using the given brush and dimension.
Declaration
public void OutlineFillRectangle(IBrush outline, IBrush fill, Rectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the rectangle. |
Rectangle | rectangle | A Rectangle structure that determines the boundaries of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
OutlineFillRectangle(IBrush, IBrush, Single, Single, Single, Single, Single)
Draws a filled rectangle with an outline around it by using the given brush and dimension.
Declaration
public void OutlineFillRectangle(IBrush outline, IBrush fill, float left, float top, float right, float bottom, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
OutlineLine(IBrush, IBrush, Line, Single)
Draws a line at the given start and end point with an outline around it.
Declaration
public void OutlineLine(IBrush outline, IBrush fill, Line line, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the line. |
Line | line | A Line structure including the start and end Point of the line. |
Single | stroke | A value that determines the width/thickness of the line. |
OutlineLine(IBrush, IBrush, Point, Point, Single)
Draws a line at the given start and end point with an outline around it.
Declaration
public void OutlineLine(IBrush outline, IBrush fill, Point start, Point end, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the line. |
Point | start | A Point structure including the start position of the line. |
Point | end | A Point structure including the end position of the line. |
Single | stroke | A value that determines the width/thickness of the line. |
OutlineLine(IBrush, IBrush, Single, Single, Single, Single, Single)
Draws a line at the given start and end point with an outline around it.
Declaration
public void OutlineLine(IBrush outline, IBrush fill, float startX, float startY, float endX, float endY, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the line. |
Single | startX | The start position of the line on the x-axis |
Single | startY | The start position of the line on the y-axis |
Single | endX | The end position of the line on the x-axis |
Single | endY | The end position of the line on the y-axis |
Single | stroke | A value that determines the width/thickness of the line. |
OutlineRectangle(IBrush, IBrush, Rectangle, Single)
Draws a rectangle with an outline around it by using the given brush and dimension.
Declaration
public void OutlineRectangle(IBrush outline, IBrush fill, Rectangle rectangle, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the rectangle. |
Rectangle | rectangle | A Rectangle structure that determines the boundaries of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
OutlineRectangle(IBrush, IBrush, Single, Single, Single, Single, Single)
Draws a rectangle with an outline around it by using the given brush and dimension.
Declaration
public void OutlineRectangle(IBrush outline, IBrush fill, float left, float top, float right, float bottom, float stroke)
Parameters
Type | Name | Description |
---|---|---|
IBrush | outline | A brush that determines the color of the outline. |
IBrush | fill | A brush that determines the color of the rectangle. |
Single | left | The x-coordinate of the upper-left corner of the rectangle. |
Single | top | The y-coordinate of the upper-left corner of the rectangle. |
Single | right | The x-coordinate of the lower-right corner of the rectangle. |
Single | bottom | The y-coordinate of the lower-right corner of the rectangle. |
Single | stroke | A value that determines the width/thickness of the line. |
Recreate(IntPtr)
Destroys the current drawing device and creates a new one with the same attributes.
Declaration
public void Recreate(IntPtr hwnd = default(IntPtr))
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hwnd | Uses the new window as the surface if set. |
Resize(Int32, Int32)
Tells the Graphics surface to resize itself on the next Scene.
Declaration
public void Resize(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | width | A value Determining the new width of this Graphics surface. |
Int32 | height | A value Determining the new height of this Graphics surface. |
Setup()
Sets up and finishes the initialization of this Graphics surface by using this objects properties.
Declaration
public void Setup()
ToString()
Converts this Graphics instance to a human-readable string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representation of this Graphics. |
Overrides
| Improve this Doc View SourceTransformEnd()
Removes the transformation matrix. it does not change the position, shape, or size of any drawing operations anymore.
Declaration
public void TransformEnd()
TransformStart(TransformationMatrix)
Specifies a matrix to which all subsequent drawing operations are transformed.
Declaration
public void TransformStart(TransformationMatrix matrix)
Parameters
Type | Name | Description |
---|---|---|
TransformationMatrix | matrix | The matrix used for the transformation. |
UseScene()
Creates a new Scene which handles BeginScene and EndScene within a using block.
Declaration
public Scene UseScene()
Returns
Type | Description |
---|---|
Scene | The Scene this method creates. |
Events
| Improve this Doc View SourceRecreateResources
Fires when the device gets recreated. Brushes and images need to be created again since the device has changed.
Declaration
public event EventHandler<RecreateResourcesEventArgs> RecreateResources
Event Type
Type | Description |
---|---|
EventHandler<RecreateResourcesEventArgs> |