DBReadPCT

Demonstrates how to read PCT.

Remarks

The following example illustrates how to read a PCT and then prints the PCT values out in tabular form.

Code

  local        byte pct[768], int tfid, int i

  tfid = DBOpen( GetPCIHOME() + "/demo/irvine.pix", "r" )
  call DBReadPCT( tfid, 7, pct )
  call DBClose( tfid )
  for i = 1 to 256
    print i, " ", pct[i], " ", pct[i+256]," ", pct[i+512]
  endfor

Output

1 0 0 255
2 136 0 0
3 153 0 0
4 170 0 0
5 187 0 0
6 204 0 0
7 221 0 0
8 238 0 0
9 255 0 0
...
...
...
251 255 255 255
252 255 255 255
253 255 255 255
254 255 255 255
255 255 255 255
256 255 255 255

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.