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.
|