The code below sets a renderer to my point shapefile. When the layer is loaded all symbols are rendered correctly, however when I add a new point to the layer this is rendered using the default symbol. Only when I reload the layer the newly added point is rendered using the defined categories. A redraw or refresh of the map alone does not help.
Another problem is that the transparency does not seem to work. The transparent color I pass is coloured in a light gray.
This is the renderer code:
Private Sub ApplyRendererPointRefLayer() Dim sdo As MapWinGIS.ShapeDrawingOptions = mPointRef.DefaultDrawingOptions Dim index As Integer = mPointRef.Table.FieldIndexByName("sterkte") For i As Integer = 0 To 3 Dim NetImage As New System.Drawing.Icon(mMapWin.Plugins.PluginFolder + "\GPR\Images\PRef" + i.ToString() + ".ico") Dim imgUtil As New ToolsImages Dim ico As New MapWinGIS.Image ico.Picture = imgUtil.ImageToIPictureDisp(CType(NetImage.ToBitmap(), System.Drawing.Image)) ico.TransparencyColor = Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.FromArgb(0, 128, 128))) ico.UseTransparencyColor = True mPointRef.Categories.Add(i.ToString()) mPointRef.Categories.Item(i).Expression = "[sterkte]= " & i.ToString mPointRef.Categories.Item(i).DrawingOptions.PointType = MapWinGIS.tkPointSymbolType.ptSymbolPicture mPointRef.Categories.Item(i).DrawingOptions.Picture = ico mPointRef.Categories.ApplyExpression(i) ico = Nothing Next i End Sub
But I can't give a quick answer regarding transparency issue, I need to test the code.
Hope it'll help,
I hope you can look into the transparency issue.
It might be best to submit an issue report about the transparency so we don't forget.
Please go to bugs.mapwindow.org
Thanks en bedankt,
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
Follow me on Twitter MapWindow_nl to read when a new installer is published.
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
View my profile on LinkedIn
Recently I downloaded MapWindow 4.8.6 and rendering point features with images does not work anymore, using the code and Sergei's suggestion above. The previous version did draw the images. This is a very serious issue for my project, could you please look into this?
The transparancy issue is less important to me, but is there any progress on this issue?