From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

changing colour of all objects using IMAQ

Hi
I work on CIMAQ 8.2 and visual basic. Does anyone know how to change the colour of particles in the binary image instead of the default red coulor. the label function assigns a color to each object. I only want to change the color of all objects to different colour. Thanks
Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 1 of 5
(3,509 Views)
Hi Waleed,

Thank you for posting to the NI forums!  Your post is similar to another post about this topic, so refer to the linked forum post below for more detail on the matter.  Essentially, the function you are looking for is CWIMAQPalette.SetPalette RedPlane, GreenPlane, BluePlane.  If you set the colours manually, the palette type is set to user defined, otherwise the type is one of the four preset types (the binary type containing the red/black you are trying to change).

previous forum post: Can I get a different color than black in Threshold?

I hope this helps!
Maclean G.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,499 Views)
Thanks Mclean, however this enabled me to change the background, but you showed me the way.Smiley Happy
Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 3 of 5
(3,455 Views)

 


@MacleanG wrote:
 
Hi Waleed,

Thank you for posting to the NI forums!  Your post is similar to another post about this topic, so refer to the linked forum post below for more detail on the matter.  Essentially, the function you are looking for is CWIMAQPalette.SetPalette RedPlane, GreenPlane, BluePlane.  If you set the colours manually, the palette type is set to user defined, otherwise the type is one of the four preset types (the binary type containing the red/black you are trying to change).

previous forum post: Can I get a different color than black in Threshold?

I hope this helps!
 

 

Hi

I bumped into this thread because I'm using a CWIMAQViewer to display a 12-bit grayscale image (0-4095).   Our application gives the user the ability to specify an intensity value, say 4000, so that pixels below this value display normally as gray scale, and pixels above the value appear RED.   This also needs to be achieved at runtime.   

 

I tried to alter the palette using your your suggestion: 

                 CWIMAQPalette.SetPalette RedPlane, GreenPlane, BluePlane

But, what is the data type of Red/Green/Blue Plane?  There're 256 entries in the palette.   How do I change individual entries?

 

 

I guess the more general quesiton is:

Where can I find the programming APIs of the CWIMAQContrlLibrary for VisualStudio.net?  I will need to use other controls and functions in the library, and without the API it's impossible.

 

Thanks.

 

 

 

 

 

 

0 Kudos
Message 4 of 5
(2,891 Views)

Hi aoslo,

 

Your questions will receive more attention by creating a new thread. It's not recommended to post on extremely old threads which I believe this thread qualifies as. Below I've linked the NI Discussion Forums User Guidelines as well as general getting started resources.

 

http://forums.ni.com/t5/Getting-Started-on-the-NI/NI-Discussion-Forums-User-Guidelines/td-p/3164638

 

http://forums.ni.com/t5/Getting-Started-on-the-NI/bd-p/gettingstarted

 

I hope this helps!

 

- Kale

0 Kudos
Message 5 of 5
(2,880 Views)