Class ImageLayer
- Namespace
- LightningChartLib.WinForms.Charting.SeriesXY
- Assembly
- LightningChart.WinForms.Charting.NET4.dll
ImageLayer contains images rendered at given position and size. There is no limit for image count, except due computer/OS resource constraints.
ImageLayer can create sublayer of images created from original images to reduce rendered image count to improve rendering speed. Creation of sublayer could be very time consuming as it compacts original images with pixel color averaging.
[TypeConverter(typeof(ExpandableObjectConverter))]
public class ImageLayer : SeriesBaseXY, IChartNode, IDisposable, IHighlightingItem
- Inheritance
-
ImageLayer
- Implements
- Inherited Members
Constructors
ImageLayer()
Constructor for Form editor.
public ImageLayer()
ImageLayer(IChartNode, AxisX, AxisY)
Constructor.
public ImageLayer(IChartNode owner, AxisX axisX, AxisY axisY)
Parameters
ownerIChartNodeParent.
axisXAxisXX-Axis
axisYAxisYY-Axis
Properties
ConversionThreadPriority
Sublayer image conversion thread priority.
public ThreadPriority ConversionThreadPriority { get; set; }
Property Value
LegendBoxIconColor
LegendBox icon color.
public Color LegendBoxIconColor { get; set; }
Property Value
RenderingLayer
Rendering layer index. Use this to force certain sublayer images to be rendered instead of automatically derived sublayer. Restore automatic by setting this to -1.
public int RenderingLayer { get; set; }
Property Value
RenderingOrder
Rendering order. Affect whether layer is drawn before or after axis.
public ImageLayerRenderingOrder RenderingOrder { get; set; }
Property Value
Title
Layer title.
public SeriesTitle Title { get; set; }
Property Value
UseColorPaletteOptimization
Assume image palette colors to be increasing and so color selection can use palette index average instead of search for closest color based on average color calculation. This is applicable only with paletted image format.
public bool UseColorPaletteOptimization { get; set; }
Property Value
Methods
AddImageData(LayerImageData)
Add image to source layer. It is recommended to add images at a thread to keep UI responsive.
public void AddImageData(LayerImageData imageData)
Parameters
imageDataLayerImageDataImage data.
AddImageData(LayerImageData[], int)
Add image data from the array to compose tiled layers of image data. Use this method if you have all the images ready for rendering/composing.
public void AddImageData(LayerImageData[] imageData, int subLayerCount)
Parameters
imageDataLayerImageData[]Array of image data.
subLayerCountintCount of new layers created from the imageData. Bigger the value, more it takes time. Minimum is one.
Clear()
Clears all data from layer.
public override void Clear()
Construct()
Construct members.
protected override void Construct()
CreateTitle()
protected override void CreateTitle()
Dispose(bool)
Clean up any resources being used.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue if managed resources should be disposed, otherwise false.
EnableSublayerConversion(bool)
Enable/disable conversion of sublayer images.
public void EnableSublayerConversion(bool enable)
Parameters
enableboolparam enable M:LightningChartLib.WinForms.Charting.SeriesXY.ImageLayer.EnableSublayerConversion(System.Boolean)
EndAddingImages(int, int)
End adding source images to the layer. Processing of images on various sublayers starts with own thread.
public void EndAddingImages(int subLayerCount, int baseColorIndex = 0)
Parameters
subLayerCountintZoom level count. Large count of zoom levels is very slow to compute. Prefer values like 1-3. With zero, new layer is not created.
baseColorIndexintBase color index. Palette color in this index will be used for empty space color. Not applicable to full color images, just paletted images.
GetMinMaxValues(out double, out double, out double, out double)
Get minimum and maximum X and Y values.
public bool GetMinMaxValues(out double xMin, out double xMax, out double yMin, out double yMax)
Parameters
Returns
- bool
True if point count is greater than 0
GetTitleText()
public override string GetTitleText()
Returns
- string
returns M:LightningChartLib.WinForms.Charting.SeriesXY.ImageLayer.GetTitleText
LoadLayerFromFolder(string)
Load layer from file system folder.
public bool LoadLayerFromFolder(string folder)
Parameters
folderstringFolder to load images,
Returns
- bool
True, if succeed, false otherwise.
SaveLayerToFolder(string)
Save layer to file system folder. Will save all created and original images.
public bool SaveLayerToFolder(string folder)
Parameters
folderstringFolder to store layer images.
Returns
- bool
True, if succeed, false otherwise.
StartAddingImages()
Start adding images to the layer.
public void StartAddingImages()
ToString()
Convert class description to string.
public override string ToString()
Returns
- string
Class description as a string.
Events
ProgressEvent
Indicates progress of ImageLayer conversion process. NOTE! This may be called from non-ui thread, so caller need to switch to ui-thread in the handler, if needed.
public event ImageLayer.ImageLayerConversionProgressEventHandler ProgressEvent