View Single Post
Old 07-09-2009, 06:50 AM
koko koko is offline
Global Mapper User
 
Join Date: Jun 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default fill color to area

Help me please,

i use Visual C# (VS2008) Sample Application , load shape file it have 2000 areas and i want to fill color some area but it can't.

this is my code

private void FillColor()
{
// theAreaStyle is global variable, i set value to it on load layer.
theAreaStyle.mBrushColor = ColorToUInt(Color.Red);

for (UInt32 i = 0; i <= 500; i++)
{
LastGMError = GlobalMapperDLL.GM_SetAreaFeatureDrawStyle(clsGlob alVARS.LayerHandles[0], i, ref theAreaStyle);
}
DrawLayersToBitmap();
}
private uint ColorToUInt(Color color)
{
return (uint)((color.A << 24) | (color.R << 16) |
(color.G << 8) | (color.B << 0));
}
public static extern GM_Error_t32 GM_SetAreaFeatureDrawStyle
(
IntPtr aLayer, // Layer the area is in
UInt32 aAreaIndex, // Index of area in layer
ref GM_AreaStyle_t aAreaStyle // New style to use for area
);

when i call FillColor function
LastGMError = GM_Error_None alway but area don't fill color.

Last edited by koko; 07-09-2009 at 06:54 AM.
Reply With Quote