Invalid image size in PictureMarkerSymbol?

1855
1
01-07-2011 10:21 AM
BorisPelakh
New Contributor
I am placing images on a custom layer, and create the PictureMarkerSymbol w/ the following:

PictureMarkerSymbol ps = new PictureMarkerSymbol();
ps.createMarkerSymbolFormFile(esriIPictureType.esriIPictureBitmap, imageLocation);
ps.setBitmapTransparancyColor(color);


I then try to obtain the size of the image from
ps.getSize()
, and I always get 8, even if the size is 16x16 or 32x32. This messes up the scaling code I use during rendering. I also tried
ps.getPicture().getHeight()/getWidth()
, and that gives me completely ridiculous values (> 400).

I previously used
createDynamicGlyphFromFile()
when the rendering used dynamic layers, and it gave me accurate sizes via
glyph.queryDimensions()
. What am I doing wrong with PictureMarkerSymbol?

Also, with dynamic glyph I could apply a color map to the image using IDynamicSymbolProperties.setColor() to apply a color mask to an image, so I could use a single white image and apply any color I wanted to it. This does not appear to work with PictureMarkerSymbol, even though there is a setColor method.
0 Kudos
1 Reply
Venkata_RaoTammineni
Occasional Contributor
I am placing images on a custom layer, and create the PictureMarkerSymbol w/ the following:

PictureMarkerSymbol ps = new PictureMarkerSymbol();
ps.createMarkerSymbolFormFile(esriIPictureType.esriIPictureBitmap, imageLocation);
ps.setBitmapTransparancyColor(color);


I then try to obtain the size of the image from
ps.getSize()
, and I always get 8, even if the size is 16x16 or 32x32. This messes up the scaling code I use during rendering. I also tried
ps.getPicture().getHeight()/getWidth()
, and that gives me completely ridiculous values (> 400).

I previously used
createDynamicGlyphFromFile()
when the rendering used dynamic layers, and it gave me accurate sizes via
glyph.queryDimensions()
. What am I doing wrong with PictureMarkerSymbol?

Also, with dynamic glyph I could apply a color map to the image using IDynamicSymbolProperties.setColor() to apply a color mask to an image, so I could use a single white image and apply any color I wanted to it. This does not appear to work with PictureMarkerSymbol, even though there is a setColor method.


http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriDisplay/CreateMarkerSymbolFromFile_Example.h...
0 Kudos