OEDrawLegendLayout

bool OEDrawLegendLayout(OELegendLayout &layout)

Draws the legend layout.

Note

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

Example

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

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

  OEWriteImage("LegendLayout.svg", image);

Hint

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

Download code

LegendLayout.cpp

click on the "Legend" label

Example of using the OEDrawLegendLayout function

../../_images/LegendLayout.svg