Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically set window palette

I am using ComponentWorks for visual c++.

How do I set the window palette to type binary if i want to display a binary image? I want to programatically set the palette to grayscale if the user wants to view a grayscale image, and to binary if the user chooses to view a binary image.

Thanks
0 Kudos
Message 1 of 4
(3,361 Views)
Hello,

You can call CWIMAQViewer.Palette with a CWIMAQPalette.Type selected to one of the possible constants below:

cwimaqPaletteBinary�Binary palette. Contains 16 cycles of 16 different colors. This periodic palette is appropriate for the display of binary and labeled images.

cwimaqPaletteGradient�Gradient palette. A gradation from red to white with a prominent range of light blue in the upper value range.

cwimaqPaletteGrayScale�Grayscale palette. A gradual gray level variation from black to white.

cwimaqPaletteRainbow�Rainbow palette. A gradation from blue to red with a prominent range of greens in the middle value range.

cwimaqPaletteTemperature�Temperature palette. A gradation of brown.

cwimaqPaletteUserDefined�A user-defined palette.


See IMAQ Vision for Visual Basic reference if you need further information on this.

Best regards,

Yusuf C.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(3,361 Views)
Thanks Yusuf,
But I don't think that will work for me. I am using C++ and the ActiveX interface. The CWIMAQViewer class doesn't have a Palette attribute. I also can't find where cwimaqPaletteBinary is defined. Is there a IMAQ vision for Visual C++ reference?
0 Kudos
Message 3 of 4
(3,361 Views)
Hello,

You can find the C version of the same reference file at http://digital.ni.com/manuals.nsf/websearch/7734B7E41B9B0EF086256A3F0053DA28?OpenDocument&node=132100_US

Yusuf C.
0 Kudos
Message 4 of 4
(3,361 Views)