Select to view content in your preferred language

Multiply Raster Grid by a variable value in ArcObjects?

875
2
08-25-2010 01:07 AM
Ahmed_Wagih_Abdel-LatifAzab
Emerging Contributor
Dear All,

I know I can use the following to multiply a grid by a value in ArcObjects:

        Dim pOutRaster As IRaster
        pOutRaster = pMapAlgebraOp.Execute("[R1] * 5")

but how can I make the value of "5" variable instead of a value?

Thanks,
0 Kudos
2 Replies
ParitoshGupta
Occasional Contributor
Hi
   You can set a variable say "var" as per the following code:-


Dim Var As Integer
Var = 5
pOutRaster = pMapAlgebraOp.Execute("[R1] * " & Var)
0 Kudos
Ahmed_Wagih_Abdel-LatifAzab
Emerging Contributor
Thanks Paritosh, it worked like a charm.
0 Kudos