Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

Closed Issue: Shapefile Legend Colours and Shape Fill Colours [21882]

$
0
0
Using V4.7SR of the ActiveX component in an Access VBA project, I would previously apply legend colour schemes to shapefiles using one of two methods, either the ShapeFillColor method of the map object, e.g.:
 
Select Case rst!STATUS_CODE
Case 0
MapObj.ShapeFillColor(Handle, lngShapeNum) = RGB(0, 0, 255)
Case 1
MapObj.ShapeFillColor(Handle, lngShapeNum) = RGB(255, 255, 28)
Case 2
MapObj.ShapeFillColor(Handle, lngShapeNum) = RGB(227, 183, 28)
Case 3, 7
MapObj.ShapeFillColor(Handle, lngShapeNum) = vbRed
Case 4
MapObj.ShapeFillColor(Handle, lngShapeNum) = vbCyan
Case 5, 8
MapObj.ShapeFillColor(Handle, lngShapeNum) = RGB(200, 255, 155)
Case 6
MapObj.ShapeFillColor(Handle, lngShapeNum) = vbGreen
Case 9
MapObj.ShapeFillColor(Handle, lngShapeNum) = vbMagenta
End Select
 
or via the ShapefileColorScheme and ShapefileColorBreak objects, e.g.:
 
Set pColourScheme = New ShapefileColorScheme

Set pColourBreak = New ShapefileColorBreak
With pColourBreak
.Caption = "Not yet fished"
.EndColor = RGB(0, 0, 255)
.StartColor = RGB(0, 0, 255)
.StartValue = 0
.EndValue = 0
.Visible = True
End With
pColourScheme.Add pColourBreak
 
' Apply the colour scheme
pColourScheme.FieldIndex = 9
pColourScheme.LayerHandle = hnd
map0.ApplyLegendColors pColourScheme
 
After upgrading to V4.8.6 of the ActiveX component, neither of these methods work. Shapefiles appear with random solid-fill colours only.
Comments: Description of new API was suggested.

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>