How to make a picture marker symbol


Summary
This article shows how to create a picture marker symbol.

Making a picture marker symbol

A picture marker symbol can be created using either a Windows bitmap (BMP) or enhanced metafile (EMF) as the underlying artwork for the symbol. The following code shows an example for using both types of files as the input. You will need to modify the input path for each type to point to the appropriate file.
[Java]
static void pictureMarkerSymbol()throws Exception{
    // This example creates two PictureMarkerSymbols
    // One from an .EMF file and another from a .BMP file.

    // Set the Transparent background color for the .BMP based
    // Picture Marker symbol to white.
    IRgbColor color = new RgbColor();
    color.setRed(255);
    color.setGreen(255);
    color.setBlue(255);

    // Create the EMF Marker and assign properties.
    IPictureMarkerSymbol emfMarkerSymbol = new PictureMarkerSymbol();
    emfMarkerSymbol.createMarkerSymbolFromFile(esriIPictureType.esriIPictureEMF, 
        "c:\\temp\\mypict.emf");
    emfMarkerSymbol.setAngle(0);
    emfMarkerSymbol.setSize(24);
    emfMarkerSymbol.setXOffset(0);
    emfMarkerSymbol.setYOffset(0);

    // Create the Bitmap Marker and assign properties.
    IPictureMarkerSymbol bmpMarkerSymbol = new PictureMarkerSymbol();
    bmpMarkerSymbol.createMarkerSymbolFromFile(esriIPictureType.esriIPictureBitmap, 
        "c:\\temp\\mypict.bmp");
    bmpMarkerSymbol.setAngle(0);
    bmpMarkerSymbol.setBitmapTransparencyColor(color);
    bmpMarkerSymbol.setSize(32);
    bmpMarkerSymbol.setXOffset(0);
    bmpMarkerSymbol.setYOffset(0);
}


See Also:

How to make a cartographic line symbol
How to make a character marker symbol
How to make a gradient fill symbol
How to make a line callout
How to make a line fill symbol
How to make different types of colors




Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine