Reads data from a Device Independent Bitmap (DIB) format file into a variable.
ColorsUsed Returns the number of colors used by the bitmap image (long).
Compression Returns the compression style used in the DIB image. Valid values are:
0 | None (no compression) |
1 | Run-length encoded format for bitmaps with 8 bits per pixel |
2 | Run-length encoded format for bitmaps with 4 bits per pixel |
ImageWidth Returns the DIB image width (long).
ImportantColors Returns the number of colors that are important for the image to be displayed as it was saved (long).
XResolution Returns the number of pixels per meter in the x direction (long).
YResolution Returns the number of pixels per meter in the y direction (long).
DC_READ_DIB enables you to import DIB images into variables. It handles: 1) opening the file, 2) assigning it a logical unit number (LUN), 3) closing the file when you are finished reading the data, and 4) automatically redimensioning the input variable.
TIP: To read the contents of a DIB file directly into a graphics window without the intermediate step of having the data placed in a variable, use the function WREAD_DIB.
head.gif
contains DIB data that was exported either from PV-WAVE or from another application. To read this data directly into a variable headimg
, enter:
status = DC_READ_DIB('head.gif', headimg, $ Imagewidth=xsize, Imagelength=ysize, Colormap=colors)
xsize
and ysize
. The DIB image colormap is returned in the 2D array variable colors
.