I am using IMAQ Vision for Measurement studio in Visual Basic and need to output an image with a specific palette. Whatever I have tried has resulted in a default grayscale palette being used for the output. Note, my input image has been thresholded to a binary, but this problem also occurs with a full range of values in the image. Most of the time the grayscale work but I really need color for this output!
Here are the steps I am using
'Threshold Image
CWIMAQVision1.Threshold CWIMAQViewer1.Image, CWIMAQViewer1.Image, 1, 255, True, 1
‘On screen I now have a red 1 and black zero values when using the Binary Palette, that is how I would like the output to be!
'OUTPUT JPG
'Output Image
OutName = App.Path & "/" & App.EXEName & "Test" & ".jpg"
CWIMAQViewer1.Palette = cwimaqPaletteBinary
CWIMAQVision1.WriteImage CWIMAQViewer1.Image, OutName, cwimaqFileJPEG, CWIMAQViewer1.Palette
The image I get is Black! If I threshold to 254, I get Periwinkle as the color, (127, 127, 255) on screen and white for the same values in the output image. I am new to IMAQ Vision for Measurement studio in Visual Basic and may just be missing something in the syntax, the help files don’t help explain this except grayscale is the default! How do I override this?
Secondly is there a way to take the current image from CWIMAQVision1 and place it in a VB Picture box? Similar to Picture1.Picture = Picture2.Image in VB takes the current image and transfers it to another picture box?