Page 1 of 1

Surface Palette

Posted: Mon May 10, 2004 8:43 am
by 6925541
I'am trying to use my own palette with my Surface plot, but i looks not right. I create a palette from yellow to blue in 25 steps. Does the surface plot interpolate the data it self, i have the sample in a zip file eventualy

Code: Select all

    With Me.tchGrafiek

            .RemoveAllSeries
            
            .AddSeries scSurface

            With .Series(.SeriesCount - 1).asSurface
                
                .NumXValues = 100
                .NumZValues = 23
                
                .SmoothPalette = True
                
                dblMax = -9000000000000#
                dblMin = 9000000000000#
                
                For lngT = 1 To 100
                    For lngV = 1 To 23
                        .AddXYZ lngJaar(lngT), dblLVOMatrix(lngT, lngV), ngLVOjaar(lngV), "", clTeeColor
                        If dblLVOMatrix(lngT, lngV) < dblMin Then dblMin = dblLVOMatrix(lngT, lngV)
                        If dblLVOMatrix(lngT, lngV) > dblMax Then dblMax = dblLVOMatrix(lngT, lngV)
                    Next lngV
                Next lngT
                
                .Pen.Visible = False
                
                .UsePalette = True
                .UseColorRange = False

                ' number of pallettesteps
                lngAantal = 25
                .PaletteSteps = lngAantal
                
                ' clear palette
                .ClearPalette
                ' build palette
                For lngJ = 1 To lngAantal
                    dblValue = dblAXmin + lngJ * dblStep
                    strRegel = IniGetString("COLORMAP", Format(intJ, "00"), "")
     
                    intR = Val(strtok(1, strRegel, ";")) * 255#
                    intG = Val(strtok(1, "", ";")) * 255#
                    intB = Val(strtok(1, "", ";")) * 255#

                    .AddPalette dblValue, RGB(intR, intG, intB)
                Next lngJ
                
            End With
            
            .Repaint
[/list]