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.java

click on the "Legend" label

Example of using the OEDrawLegendLayout function