MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
MgByteReader* MgLayer::GenerateLegendImage ( INT32  width,
INT32  height,
CREFSTRING  format,
INT32  geomType,
INT32  themeCategory 
)

Returns the legend image for the specified geometry type and theme category.

.NET Syntax
virtual MgByteReader GenerateLegendImage(int width, int height, string format, int geomType, int themeCategory);
Java Syntax
virtual MgByteReader GenerateLegendImage(int width, int height, String format, int geomType, int themeCategory);
PHP Syntax
virtual MgByteReader GenerateLegendImage(int width, int height, string format, int geomType, int themeCategory);
Parameters:
resource(MgResourceIdentifier) Input MgResourceIdentifier object identifying the layer definition resource.
scale(double) Input The scale at which the symbolization is requested.
width(int) Input The requested image width in pixels.
height(int) Input The requested image height in pixels.
format(String/string) Input Image format, from MgImageFormats. Example: PNG, JPG, PNG8, etc
geomType(int) Input The type of symbolization required: 1=Point, 2=Line, 3=Area, 4=Composite
themeCategory(int) Input The value indicating which theme category swatch to return. Used when there is a theme defined at this scale. An exception will be thrown if a requested them category doesn't exist.
Remarks:
The map's current scale is used to determine what scale range in the layer definition to search for
Returns:
Returns a stream representing the legend image. The default returned image format will be PNG8 unless a different supported format is requested. An exception will be thrown if an unsupported image format is requested.
Exceptions:
MgArgumentOutOfRangeException
MgInvalidResourceTypeException
MgNullArgumentException
MgInvalidImageFormatException
Since:
3.0