MapWindow 4 - Plugins : MapWindow Discussion Forum
Does anyone know how I can select a shape in a polygon shape file or change the color of 1 polygon in a shapefile? I am trying to change the color of a polygon when I hover over it with the mouse. I have the piece of code working where I determine that I am hovering over a sha
Select shapes or change shape outline color?
Posted by:
moliver2000 ()
Date: April 13, 2010 08:45AM
Does anyone know how I can select a shape in a polygon shape file or change the color of 1 polygon in a shapefile?
I am trying to change the color of a polygon when I hover over it with the mouse.
I have the piece of code working where I determine that I am hovering over a shape, I just need to change it's color to show that.
Thanks in advance.
I am trying to change the color of a polygon when I hover over it with the mouse.
I have the piece of code working where I determine that I am hovering over a shape, I just need to change it's color to show that.
Thanks in advance.
Re: Select shapes or change shape outline color?
Posted by:
pmeems ()
Date: April 14, 2010 02:13AM
You need ShapeFillColor
--
Paul
--
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:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
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
--
Paul
--
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:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
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
Re: Select shapes or change shape outline color?
Posted by:
Winston ()
Date: April 29, 2011 02:43AM
Please moliver2000,
I have problems on how can I determine that I am hovering over a shape.
Can you show me the code of this part??
Thank you very much!!
I have problems on how can I determine that I am hovering over a shape.
Can you show me the code of this part??
Thank you very much!!
Re: Select shapes or change shape outline color?
Posted by:
jcw ()
Date: April 29, 2011 05:40PM
Moliver2000,
I am in the same position as Winston. Can you post your code for hovering over a shape?
Thanks.
I am in the same position as Winston. Can you post your code for hovering over a shape?
Thanks.
Re: Select shapes or change shape outline color?
Posted by:
danofweaver ()
Date: June 26, 2011 03:08PM
Winston and JCW,
This works for me...
Which places the feature ID in CurrentFeatureID.
BUT COLOR QUESTION In New Version...
In the plugin I'm developing before upgrade to MW 4.8 (fantastic- congratulations all involved) I could successfully change colors of shapes. Now I get no error but no color change. Please advise.
Sample code below with or without refresh...
This works for me...
Dim ProjectedLocation As New Drawing.Point g_MapWin.View.PixelToProj(ScreenX, ScreenY, ProjectedLocation.X, ProjectedLocation.Y) Dim testShapefile As New MapWinGIS.Shapefile testShapefile = oMW.Layers(g_MapWin.Layers.CurrentLayer).GetObject() Dim CurrentFeatureID As Integer CurrentFeatureID = testShapefile.PointInShapefile(ProjectedLocation.X, ProjectedLocation.Y)
Which places the feature ID in CurrentFeatureID.
BUT COLOR QUESTION In New Version...
In the plugin I'm developing before upgrade to MW 4.8 (fantastic- congratulations all involved) I could successfully change colors of shapes. Now I get no error but no color change. Please advise.
Sample code below with or without refresh...
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
For x = 0 To oMW.Layers(oMW.Layers.CurrentLayer).Shapes.NumShapes - 1
oMW.Layers(0).Shapes(x).ShapeFillColor = Color.Blue
oMW.Layers(oMW.Layers.CurrentLayer).Shapes(x).ShapeLineColor = Color.Red
Next
oMW.Refresh()
End Sub
Re: Select shapes or change shape outline color?
Posted by:
pmeems ()
Date: June 27, 2011 01:15AM
Here's a similar post about coloring shapes in the new version of MW:
[www.mapwindow.org]
You need to use categories now.
Hope it helps,
Paul
--
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:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
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
[www.mapwindow.org]
You need to use categories now.
Hope it helps,
Paul
--
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:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.
---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
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
Re: Select shapes or change shape outline color?
Posted by:
danofweaver ()
Date: June 27, 2011 02:23AM
Thanks Paul. I guess this new approach will be covered in documentation. I still don't understand how to change the color of a specific shape to a specific color under the new version. I'll add my query to the thread you've pointed me to (http://www.mapwindow.org/phorum/read.php?3,22779). Thanks for your help. Dan
Sorry, only registered users may post in this forum.


