LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

VAL_SIZE_TO_IMAGE not working as expected

I have an UIR done with CVI 5. which includes several ring controls in which I inserted several PCX images. As the UIR is quite complex and should fit the screen, I used the option "Size Image to Control" for all controls.

It worked fine and was quite impressive.

Recently, I tried to migrate this UIR to CVI 7 (Last version to work on NT). The option "Size Image to Control" causes the image to be very unclear - few pixels, every line turns in several sparsed dots... IT DOES NOT WORK!!!

I need some help with this.

0 Kudos
Message 1 of 6
(3,382 Views)

Hi YOS,

 

I tried importing a PCX image into CVI 2010 and then sizing the image to the control and didn't see the behavior you have been describing.  Would you mind posting an example (alongside an image file) that demonstrates this?

 

Also, one thing I noticed is that PCX images appear to be quite dated.  Could upgrading them to a JPEG or PNG format be an option for you?

 

 

Thanks,

 

Stephanie R.

National Instruments

Stephanie R.
National Instruments
0 Kudos
Message 2 of 6
(3,371 Views)

@srdfrn wrote:

Hi YOS,

 

I tried importing a PCX image into CVI 2010 and then sizing the image to the control and didn't see the behavior you have been describing.  Would you mind posting an example (alongside an image file) that demonstrates this?

 

Also, one thing I noticed is that PCX images appear to be quite dated.  Could upgrading them to a JPEG or PNG format be an option for you?

 

 

Thanks,

 

Stephanie R.

National Instruments



Stephanie, thanks for the reply.

I am very sorry to state that I made a mistake.

VAL_SIZE_TO_IMAGE indeed works.

What fails to work is VAL_SIZE_TO_PICTURE. (Second option in Fit Mode attribute in control editing panel)

I tried with JPEG and it's the same.

I am attaching an example.(Load_Image.c & ONEP_3Trow_POS1.JPG)

A panel with two picture rings.

- SW_1 remains at the intended size and the loaded picture is not clear.

- SW_2 will fit to picture size and looks OK.

 

Appreciate your support,

 

YOSsi Seter

 

Download All
0 Kudos
Message 3 of 6
(3,354 Views)

Hi YOSsi Seter,

 

Unfortunately, this is expected behavior with an image like that.  As you decrease its size, it drops in resolution.  Because the posted image is so simple, this translates to missing lines.  You can see the same results if you resize that JPG in MS Paint, as well.  One option for a workaround would be to write an algorithm that draws that image on a canvas control, since it's pretty simple (just a few circles, lines, a rectangle and an arrow). 

 

Hope this helps!

 

 

Regards,

 

Stephanie R.

National Instruments

Stephanie R.
National Instruments
0 Kudos
Message 4 of 6
(3,331 Views)

But it worked fine (and still works) with CVI 5.01?!

What's the difference?

0 Kudos
Message 5 of 6
(3,325 Views)

Ah, actually I do not know what changed between these versions of CVI.  Thus, I've filed a bug report with R&D (ID# 306560) so they can take a closer look at the issue.  Whenever we have an answer to this, we'll post back here on the forum.

 

Thanks!

 

Stephanie R.

National Instruments

Stephanie R.
National Instruments
0 Kudos
Message 6 of 6
(3,307 Views)