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

New Post: GridColorScheme not working on int data types

$
0
0
I've recently upgraded from 4.8.3 to 4.9.0. The code that I had previously to display a grid using a GridColorScheme has stopped working on integer (unsigned 8 bit) but if I convert the tif to a float (32) it will work.

A stripped down version of my code:
Dim img As New MapWinGIS.Image
        Dim fname_float32 As String = "Z:\asb\HavasuNWR\DSS_Tools\HavasuDSS\InitialData\DefaultSessionDirectoryWorkingCopy\Outputs\Segments\Topock_1\topock1_ycra_breeding_138.600_compressed_float.tif"
        Dim fname_unsignedint8 As String = "Z:\asb\HavasuNWR\DSS_Tools\HavasuDSS\InitialData\DefaultSessionDirectoryWorkingCopy\Outputs\Segments\Topock_1\topock1_ycra_breeding_138.600_compressed.tif"
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        img.Open(fname_float32, MapWinGIS.ImageType.USE_FILE_EXTENSION, False, )
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

        img.UseTransparencyColor = True
        'imgInfo.image.TransparencyColor = Convert.ToUInt32(RGB(0, 0, 0))
        img.UpsamplingMode = MapWinGIS.tkInterpolationMode.imNone
        img.DownsamplingMode = MapWinGIS.tkInterpolationMode.imNone
        img.AllowHillshade = False


        Dim colorScheme As New MapWinGIS.GridColorScheme
        Dim r As UInt32 = Convert.ToUInt32(RGB(255, 0, 0))
        Dim g As UInt32 = Convert.ToUInt32(RGB(0, 255, 0))

        Dim breakr As New MapWinGIS.GridColorBreak
        breakr.LowValue = -1
        breakr.HighValue = 50
        breakr.LowColor = r
        breakr.HighColor = r
        breakr.Caption = "red"
        colorScheme.InsertBreak(breakr)

        Dim breakg As New MapWinGIS.GridColorBreak
        breakg.LowValue = 51
        breakg.HighValue = 999999
        breakg.LowColor = g
        breakg.HighColor = g
        breakg.Caption = "red"
        colorScheme.InsertBreak(breakg)

        img._pushSchemetkRaster(colorScheme)



        Dim img_handle As Integer
        img_handle = AxMap2.AddLayer(img, True)
if I point to the int version of the file I get:
Image

If I point to the float version of the file I get:
Image

Thanks!

Viewing all articles
Browse latest Browse all 2341

Trending Articles



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