symbols are distorted

Topics: WinForms Controls
Oct 30, 2009 at 5:12 PM



I can't seem to get sharpmap to put symbols on a layer which is just points without distorting the image.

I've tried setting SymbolScale to 1.0 and then 0.9 and then 0.8 but no success. It takes a nice icon and makes it quite blurred.

This seems like quite a simple thing but I would appreciate some help.




Oct 30, 2009 at 5:14 PM

See for an example of a screen capture of the icon and sharpmap window

Oct 30, 2009 at 9:44 PM

Hi Paul, from your image I am unclear if the map is being displayed in a MapImage/MapControl or a PictureBox. If it is a PictureBox then in may be being stretched. Anyway you want 1.0f as the scale hth j

Oct 31, 2009 at 5:39 AM

Hi John,


I'm using a MapImage control.


This is the code I use to load the layer onto the MapImage:

SharpMap.Data.Providers.GeometryFeatureProvider gfpAirports = new SharpMap.Data.Providers.GeometryFeatureProvider(fdtAirports);
                            SharpMap.Layers.VectorLayer layerAirports = new SharpMap.Layers.VectorLayer(layerName.ToString());
                            layerAirports.DataSource = gfpAirports;
                            layerAirports.Style.Symbol = Properties.Resources.windsoc16x16k;
                            layerAirports.Style.SymbolScale = 1.0f;

SharpMap.Map myMap = new SharpMap.Map();
            myMap.MinimumZoom = 0.1; //Minimum zoom allowed
            myMap.BackColor = Color.White; //Set background


            mapImage1.Map = myMap;

Oct 31, 2009 at 2:21 PM

Just to clarify - when I looked at the definition of MapImage control it extends the standard .NET PictureBox control. But the MapImage is the only control I could find when I added the SharpMap dll's to my toolbox.


Oct 31, 2009 at 11:47 PM


It has been a while since I have used the 0.9 controls but it sounds like the control is being stretched possibly due to docking or anchoring. Try setting StretchMode (iirc) to Center.. apologies for code block - only way to post from my phone... hth jd



Nov 1, 2009 at 6:12 AM

Hi John,


Thanks for the help - especially over a weekend! I did try and set the SizeMode to CenterImage however that didn't work. I'm going to try and respond to window resize commands and then manually adjust the size of the control - currently it is docked to "Fill". I'll let you know what the result is.


Just to clarify - you mention it's been a while since you've used the 0.9 controls however that's the latest download on codeplex. 22nd Oct 2009. Is there a later version I could be using?




Nov 1, 2009 at 6:15 AM

Hi John,


Even with the control undocked and trying ALL the possible settings of SizeMode the bitmaps are still distorted! Whew this is quite frustrating.




Nov 2, 2009 at 10:21 AM

Hi Paul, I will try and look into it asap... btw there should be MapBox control which extends Control not PictureBox.. perhaps you could try that.

When I say about it being a while since I used the 0.9 controls irts because I am working more with v2 hth jd 

Nov 2, 2009 at 11:32 AM

Hi John,


There's definitely no MapBox control in SharpMap.UI.dll or SharpMap.dll.


You can see my ildasm dump - there's only 1 class in the SharpMap.UI.Forms namespace:


Is sharpmapv2 ready for use? I probably want to go into production within 2-3 months.



Nov 2, 2009 at 11:40 AM

It looks like you are using the really old 0.9 dlls _ I updated them the other day.. But I would still advise building the trunk from source and using Tortoise SVN to keep up to date..

SharpMap v2 is usable depending on what you need to do.. but It is in development and subject to change.. There is certainly not going to be a final release in 2 months.. hth jd

Nov 2, 2009 at 11:44 AM

Thanks - I will update from svn. Just to let you know the dll's I'm using were from 2009/10/22. So I think the release rar's are incorrect. I  just re-downloaded them from and mine are the same as the links on codeplex.

I'll get from codeplex svn though.

Is there a wiki or anything listing some major points of what v2 will have over v0.9?


Nov 2, 2009 at 12:41 PM

Ah my mistake.. MapBox is still in the tree but excluded from the project.. V2 is completely redesigned - very briefly it has:

Much closer integration with NTS and GeoAPI

MVP pattern controls

Pluggable renderers (wip)

An expressive query system


It has a steeper learning curve though and is in need of some work in various places.. hth jd

Nov 4, 2009 at 3:39 AM

Hi John,

I built the trunk and included MapBox but still the images are stretched on a MapBox control. Any ideas?

Nov 4, 2009 at 10:40 PM

Hi Paul, can you try to load your data into the demo win form project and see what you get. Also do you have data from multiple coordinate reference systems or are you applying any kind of gdi transform when rendering? cheers jd

Nov 5, 2009 at 3:37 AM
Thanks John. I will try it out. I will check the ref. Systems but they all should be the same.

Paul de Goede
+27 82 941 5151

On 05 Nov 2009, at 12:40 AM, johndiss <> wrote:

From: johndiss

Hi Paul, can you try to load your data into the demo win form project and see what you get. Also do you have data from multiple coordinate reference systems or are you applying any kind of gdi transform when rendering? cheers jd