Documentation | Samples | CustomPaint
How to do custom drawings in a platform-independent way and how to assign renderer other than default and access its low-level API (like DC, Graphics).
DK allows using different renderers. For example .NET version is capable to draw using Graphics (GDI+) or SharpDX. This sample shows how to use methods called Canvas* (eg CanvasDrawText) to draw using same API independent of a platform, operating system etc. However, it is still possible to call low-level underlying graphics object. And this sample shows how to do this.
This sample illustrates use of:
Name | Description |
---|---|
TGIS_ViewerWnd.Renderer | Currently operating renderer. |
TGIS_ViewerWnd.PaintExtraEvent | PaintExtra event. |
TGIS_LayerVector.PaintShapeEvent | PaintShape event. |
TGIS_RendererAbstract.CanvasPen | Pen of the Canvas object. |
TGIS_RendererAbstract.CanvasBrush | Brush of the Canvas object. |
TGIS_RendererAbstract.CanvasDrawBitmap | Draw bitmap on the Canvas object. |
TGIS_RendererAbstract.CanvasDrawEllipse | Draw an ellipse on the Canvas object. |
TGIS_RendererAbstract.CanvasNative | Return rendering context native to current renderer. |
TGIS_RendererAbstract.CanvasDrawText | Draw a text on the Canvas object. |
TGIS_GdipSolidBrush.create | Create a solid brush. |
TGIS_GdipGraphics.FillRectangle | Fill a rectangle. |
TGIS_GdipGraphics.DrawString | Draw a string. |
TGIS_GdipGraphics.DrawImage | Draw an image. |
TGIS_GdipFont.Create | Create a font. |
TGIS_GdipStringFormat.Create | Create a string format. |
This sample is available on following platforms (click to see source code):