HOW TO

Export the Legend as a Bitmap in VC++

Last Published: April 25, 2020

Summary

This document contains sample code to demonstrate how to export the MapObjects legend control as a bitmap.

Procedure



  1. Create a variable to store the index number of the layer to be exported.
    Use -1 to add all layers to the bitmap of the Legend.

    Code:
    short i = -1;

  2. Create a variable to store the path and location of the bitmap.

    Code:
    BSTR str = SysAllocString(L"C:\\temp\\temp.bmp");

  3. Export the Legend as a BMP file

    Code:
    m_legend.ExportToBmp(&str, &i);

Article ID:000002283

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic