jiyanliang 发表于 2013-2-4 20:12:09

to create a PictureMarkerSymbol (Picture Symbol)in ArcGIS

How to create a PictureMarkerSymbol (Picture Symbol)in ArcGIS server with C#
Author fei wang
Date Oct 13, 2007

I had spent long time for finding sample code that can show me how to create a PictureMarkerSymbol in ArcGIS server with C#. However, I couldn't find it.

Now, I figured out how to do it.
Here I would like to share my code with you.

1) add following two namespaces:
using System.Drawing;
using System.Drawing.Imaging;

2) create a System.Drawing.Image object:
System.Drawing.Image symbolImage = System.Drawing.Image.FromFile("D:\\yourimagefilepathandname.bmp");

3) create PictureMarkerSymbol.

ESRI.ArcGIS.ADF.ArcGISServer.PictureMarkerSymbol pms = new ESRI.ArcGIS.ADF.ArcGISServer.PictureMarkerSymbol();
pms.Picture = ESRI.ArcGIS.ADF.ArcGISServer.Converter.ToByteArray(symbolImage, System.Drawing.Imaging.ImageFormat.Bmp);
pms.Size = 20.0;


from esri
页: [1]
查看完整版本: to create a PictureMarkerSymbol (Picture Symbol)in ArcGIS