OEDrawLegendLayout

bool OEDrawLegendLayout(OELegendLayout &layout)

Draws the legend layout.

Note

Interactive legend can only be used in .svg image format.

Example

OELegendLayoutOptions opts = new OELegendLayoutOptions(OELegendLayoutStyle.VerticalTopRight,
                                                       OELegendColorStyle.LightGreen,
                                                       OELegendInteractiveStyle.Toggle);
opts.SetButtonWidthScale(1.5);
opts.SetButtonHeightScale(1.5);
OELegendLayout legend = new OELegendLayout(image, "Legend", opts);

OEImage legend_area = legend.GetLegendArea();
OEDepict.OEAddWatermark(legend_area, "This is the legend area");
OEDepict.OEAddInteractiveIcon(image, OEIconLocation.BottomRight, 0.75);
OEDepict.OEDrawLegendLayout(legend);

OEDepict.OEWriteImage("LegendLayout.svg", image);

Hint

The OEDrawLegendLayout function should be called after rendering all other information to the image.

Download code

LegendLayout.cs

click on the "Legend" label

Example of using the OEDrawLegendLayout function

../../_images/LegendLayout.svg