![]() |
LuciadCPillar C# 2024.1.04
|
An icon painter can paint an icon as an Image
.
More...
Public Member Functions | |
double | GetAnchorX () |
Returns the x coordinate of the anchor point in pixels. More... | |
double | GetAnchorY () |
Returns the y coordinate of the anchor point in pixels. More... | |
double | GetDisplayScale () |
Returns the display scale for which this painter is optimized. More... | |
uint | GetHeight () |
Returns the height of this icon. More... | |
uint | GetWidth () |
Returns the width of this icon. More... | |
Luciad.Drawing.Image | Paint () |
Paints the IIcon as an image. More... | |
An icon painter can paint an icon as an Image
.
This class can be used on any thread, so its implementation must be thread-safe.
Performance considerations: to make sure the rendering backend can avoid as much work as possible
IIconPainter.Paint
must be as performant as possible. This can for example be done by implementing this function lazily, i.e. avoid generating the image in the constructor of the IIconPainter
implementation. painting the image
, that is preferred. The reason is that the rendering backend might need these properties to determine if an icon should effectively be visible or not on the Map
. double Luciad.Drawing.IIconPainter.GetAnchorX | ( | ) |
Returns the x
coordinate of the anchor point in pixels.
The anchor point is the location of the icon that (by default) is attached to another object, e.g. a location on the map. This must be a value in the [0, {@link Luciad.Drawing.IIconPainter#GetWidth getWidth()}]
range. A good default implementation is to return getWidth()
/ 2.0.
double Luciad.Drawing.IIconPainter.GetAnchorY | ( | ) |
Returns the y
coordinate of the anchor point in pixels.
The anchor point is the location of the icon that (by default) is attached to another object, e.g. a location on the map. This must be a value in the [0, {@link Luciad.Drawing.IIconPainter#GetHeight getHeight()}]
range. A good default implementation is to return getHeight()
/ 2.0.
double Luciad.Drawing.IIconPainter.GetDisplayScale | ( | ) |
Returns the display scale for which this painter is optimized.
This is not necessarily the same display as the one that was used to create this painter. Some icons may only have a limited number scaled versions of their icon available. This method can then be used by the rendering backend to discover this, and to paint it at the intended size.
uint Luciad.Drawing.IIconPainter.GetHeight | ( | ) |
Returns the height of this icon.
I.e. the height of the Image
that is returned by IIconPainter.Paint
uint Luciad.Drawing.IIconPainter.GetWidth | ( | ) |
Returns the width of this icon.
I.e. the width of the Image
that is returned by IIconPainter.Paint
.
Luciad.Drawing.Image Luciad.Drawing.IIconPainter.Paint | ( | ) |
Paints the IIcon
as an image.
null
.