LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

picture colour wrong

When I load a picture into an 'edit picture' within a panel, all the colours are wrong and I can't find out how to correct this.
 
0 Kudos
Message 1 of 10
(3,795 Views)
Hi Steve,
 
What file type are you trying to impoirt into the picture controll ('edit picture')?
You say the colours are 'wrong', in what way? brightness, hue, saturation etc?
What version of CVI are you running and is it possible for you to post a snippit of the coide that you have used to set up the 'edit picture' control and import the picture?
 
If you post that information I can try my best to get a worthwhile answer for you.
Thanx
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
Message 2 of 10
(3,773 Views)

Adam,

Details as follows: CVI 6.0, Compaq PC Windows 2000, Display set as 1280x1024, 24-bit true colour

I have a panel with a picture control within it, and when I load the BMP or PCX from within the 'edit picture' controls, this is when the colours are wrong, as if the colour pallet is wrong. The picture is still wrong when I exit the 'edit control' and view the picture withint he panel.

The pictures view correctly when opened using MS photo editor.

 

many thanks,

Steve Booth

 

0 Kudos
Message 3 of 10
(3,762 Views)

Steve,

You still haven't said what was actually wrong with the colours you are seeing.  (Could you throw in a screen shot of before and after (or correct and 'wrong') pictures for me please.)

Thanx

 

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
Message 4 of 10
(3,755 Views)

Adam,

test1.jpg is the original picture, all looks OK in any viewer

test2.jpg is a screen shot of the panel showing the 'bad' picture.
 
Note. I have had to convert these to .jpg to send them to you, originals were .bmp or .pcx. Same results with both.
 
thanks,
 
Steve
 
Download All
0 Kudos
Message 5 of 10
(3,725 Views)

Hi Steve,

From the look of the pictures you have sent it's possible that the problem lies with the scaling that has been applied to the pictures when they are loaded.  I would firstly suggest that you try shrinking a BMP in a different program (say Paintbrush and MS picture viewer) to see if the scaling has the same effect as CVI.

Have you got the control to size to the picture or the control to size the picture down?

Also what type of BMP, PCX are they?  I'm assuming the bipmaps are 24bit (as is the display, but what bit accuracy have you set the picture control to?)

I Have been unable to find any specific problems with CVI 6.0 and picture controls so I can only assume it's something to do with the setup of you code.

Is there any chance you can attach your code an an example bmp (or PCX) so that I can try and recreate your problem here on my computer. From there I will will be better equiped to answer your question.

Many thanx

AdamB

Message Edited by AdamB on 01-27-2006 05:26 AM

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 6 of 10
(3,717 Views)
Steve,
To have complete control of how images are saved, including format, compression option, color depth, and resizing, I very highly recommend the freeware utility IrfanView (www.irfanview.com). 
 
While I can't comment on the CVI angle here, it seems like if you need a work-around, the "Resize/Resample" and "Decrease color depth" features IrfanView provides could be what you require before adding it to your UIR. You can also convert the image to a .png, which provides lossless compression if the bmp is proving too big to post.
 
Hope this helps.
Ian
0 Kudos
Message 7 of 10
(3,695 Views)
Steve,

I would also add that if the scaling is unintentional on your part, in other words, if you intended the second picture to look exactly like the first picture, you can do that by changing the Fit Mode setting of your picture control to "Size Control to Image". The control will then be bigger, of course, but the pictures should look identical.

Luis
NI
0 Kudos
Message 8 of 10
(3,688 Views)

Adam,

Many thanks for your reply. I have the panel set so that the BMP will size to the control.

I have not written any code to support this yet. The image I sent you of the panel is a screen shot of the panel, only just created, and the image loaded via the panel control.

I am still looking for a PC-setup or CVI-setup answer, as my collegues PC displays the image correctly.

Steve

 

0 Kudos
Message 9 of 10
(3,672 Views)
Steve,
 
You say that this control works fine on your colleagues PC.  What are the differences in your Windows setup.  As of yet I can't find anything to suggest that CVI options would have any effect on this program. 
Have you tried creating an exe out of your code to see if there is still a problem.  If so then it is a windows setup problem and not a CVI problem.
 
Have a look at your colleagues PC setup (more specifically the settings... resolution, colours, aliasing etc).  Try and match these as closely as possible and post your settings and results.  If there is still a problem I will escalate this to the main branch in the US to see if they have any better ideas.
 
Many Thanx
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 10 of 10
(3,637 Views)