Drawable Class
Represents a rectangular area that can be drawn upon, typically a window or a bitmap.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CECore assembly)
Syntax
public abstract class Drawable : ResourceObject
Remarks
A Drawable is a rectangular area that can be drawn on, typically a window or a bitmap. It should be attached to a View, and when the view is updated, the map is drawn to the window or bitmap.
The coordinates of a drawable are specified in pixels and the origin is in the upper left corner (Y axis is down).
The Drawable class is basically a frontend to an underlying, private implementation class. Several different backend implementations are available, using different graphics libraries like OpenGL or DirectX. The backend is selected by the Renderer parameter when the drawable is created. Which backend is used can greatly impact drawing performance; please see Graphics renderers supported in Carmenta Engine for more information.
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
ResourceObject
Drawable
BitmapDrawable
ExternalDrawable
WindowDrawable
Platforms
Windows, Linux, Android
Drawable Members
The Drawable type has the following members.
Properties
Name | Description |
---|---|
Background | Gets or sets the background color of the drawable. |
FogColor | Gets or sets the color of the fog in a 3D view. |
FogDensity | Gets or sets the density of the fog in a 3D view. |
Height | Gets or sets the height of the drawable in pixels. |
IsDisposed | Gets a value that tells whether the current Drawable has been disposed. Inherited from EngineObject |
Name | Gets or sets the name of the Drawable. Inherited from ResourceObject |
NativeHandle | Gets the native Carmenta Engine kernel object the current Drawable represents. Inherited from EngineObject |
PixelSize | Gets or sets a drawable-specific pixel size. |
PixelSizeAdjustments | Gets or sets a number of parameters that adjusts rendering to the DPI of the display. |
Renderer | Gets the type of graphics renderer used by the drawable. |
RendererSettings | Gets or sets a number of parameters that adjusts renderer settings. |
Gets or sets the size of a screen pixel. | |
Swap | Gets or sets a flag indicating if the front and back buffers of the drawable are swapped automatically. |
Transform | Gets or sets the current 2D affine transform. |
IUserProperties.UserProperties | Gets the AttributeSet that contains the user properties. Inherited from IUserProperties |
Width | Gets or sets the width of the drawable in pixels. |
Wireframe | Gets or sets a flag indicating that meshes in 3D should be drawn as wireframes. |
Methods
Name | Description |
---|---|
AdjustSize | Adjusts the drawable to the specified width and height. |
Clone | Creates a copy of an object. Inherited from EngineObject |
CreateSnapshot | Creates a bitmap copy of the drawable, a "snapshot". |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
DrawArc | Draws an elliptic arc. |
DrawLine | Draws a line with the specified geometry and pen. |
DrawPolygon | Draws a polygon with the specified brush and pen. |
DrawRaster | Draws a raster. |
DrawSnapshot | Draws a snapshot created by CreateSnapshot. |
DrawString | Draws a text string. |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
GetImage | Overloaded. Saves the contents of the drawable to a memory buffer, possibly with georeferencing information. |
GetNativeRendererInfo | Retrieves information necessary to perform custom native rendering. |
GetRaster | Copies all pixels in the drawable into a new Raster and returns it. |
Save | Overloaded. Saves the contents of the drawable to a file, possibly with georeferencing information. |
SetPropertiesFrom | Reserved for internal use. |
SwapBuffers | Swaps the front and back buffers of the drawable. |
TextBounds | Calculates the bounding box of a text string if drawn with DrawString. |
Events
Name | Description |
---|---|
FrameCompleted | Reserved for internal use. |