use point image as cursor

Topics: Algorithms, SharpMap v0.9 / v1.x, WinForms Controls
Jun 9, 2010 at 9:32 PM

hi

I have to use the image of a point as cusor, i want to move point like drap & frop feature, i cant find the feature of the cliked point move and save the moved point but i but know how the retrive the image used the draw the point.

the image is create in 

SharpMap.Styles.VectorStyle

with

SharpMap.Rendering.Thematics.

CustomTheme

the image color is a ramdom

there is a way the retrieve the style for a point.

 

thanks

Coordinator
Jun 9, 2010 at 10:18 PM
Edited Jun 9, 2010 at 10:24 PM

Hello longuard,

if I understand correct you have a vectorlayer showing a bunch of points, which has a theme applied to it, and now you want to get the symbol with which the point is rendered on the map.

You queried the feature alright using someProvider.ExecuteIntersectionQuery(...) and get a FeatureDataSet containing one table with one or more FeatureDataRows.
Now all you have to do is get the theme from the VectorLayer, reevaluate the style using GetStyle(...) function and there you are:

SharpMap.Rendering.Thematics ITheme theme = someVectorLayer.Theme; 
SharpMap.Styles.VectorStyle style = theme.GetStyle(theResultFeatureDataRow); 
System.Drawing.Bitmap symbol = style.Symbol; 

Hth FObermaier

Jun 9, 2010 at 10:36 PM
thx for the really fast reply