Esri Maps SDK 200.2.0
I have a CompositeSymbol made up of a PictureMarkerSymbol and optionally a Text Symbol.
The CompositeSymbol is being added to the Graphics collection on a GraphicsOverlay.
This all works very well, until screen scaling is changed from 100% to support a high DPI screen (Microsoft Surface, but simply increasing the scaling above 100% on a standard DPI monitor has the same effect).
The higher screen scaling percentage that is selected, the smaller that the image for the PictureMarkerSymbol is rendered. Ideally I would expect the images to remain a fixed size with respect to the map, as opposed to shrinking as they currently are.
I have attached two images, you can see that the CoT marker is being rendered at exactly the same size in both images, whereas the aircraft PictureMarkerSymbols are the proper size in the first image (100%) and very small in the second image (225%).
Would appreciate some feedback as to whether this is intended operation, or if it is something that can be resolved?
Solved! Go to Solution.
Aaaah I see. This occurs because you never set a size on the symbol. When that happens, it just falls back to the raw size of the image. To address this, set the width and height properties of the picture marker symbol.
> Ideally I would expect the images to remain a fixed size with respect to the map, as opposed to shrinking as they currently are.
That is exactly how that should work. At a screen scale of 200%, it should render twice the size in raw pixels (but same size in device-independent pixels).
Any chance you could share a small simple sample that reproduces this issue so we can investigate?
Thanks for the quick reply, I have been thinking of the quickest way to demonstrate the issue (our codebase is massive, and trying to carve out just this piece would take quite some time).
If you load up the ArcGIS.WPF.Viewer.NetFramework solution replace the following lines in Samples\Symbology\RenderMultilayerSymbols\RenderMultilayerSymbols.xaml.cs then you will see the issue demonstrated on the blue star symbol.
Replace lines 216 - 220:
// Create new PictureMarkerSymbolLayer from the runtime image object.
var pinMarker = new PictureMarkerSymbolLayer(img) { Size = 50 };
// Create a new multilayerpoint symbol with the PictureMarkerSymbolLayer.
var pinSymbol = new MultilayerPointSymbol(new[] { pinMarker });
with:
// Create new PictureMarkerSymbol from the runtime image object.
var pinSymbol = new PictureMarkerSymbol(img);
Then if you run at 200% scaling you will see that the blue star image is half the size that it should be (it is quite obvious compared to the camping image above it).
Aaaah I see. This occurs because you never set a size on the symbol. When that happens, it just falls back to the raw size of the image. To address this, set the width and height properties of the picture marker symbol.
Perfect, thank you. That did indeed resolve the issue.