Jump to content

Recommended Posts

Hi, guys

I'd like to have on a panel a picture box , wich support a bmp, gif and jpg file.

I'd like to have similar to picturebox on office programs.

With the native picturecontrol on labview, i have problem when i adapt the picture on the area box.

The picture loses quality.

Thank's for help me.

Link to comment

I use the picture control quite a bit and I haven't noticed any problems.

Could you be more specific when you ay the picture loses quality?

Some thoughts are:

-Somehow you are changing colour depth

or

-You have a zoom factor that is not 1 (100%)

It might help if you include a screen shot which shows the picture in both Word and LabVIEW a perhaps attach the VI itself.

Good luck.

Barrie

Link to comment

Thank's BArrie.

-Somehow you are changing colour depth
No, I'm not change the colour depth.
-You have a zoom factor that is not 1 (100%)

Yes, nice, i need to change the zooma factor to adapt the picture in the box.

I attach the VI.

The problem not support a gif file and the resize picture don't work fine.

Thank's in advantage.

Link to comment

Thank's BArrie.

-Somehow you are changing colour depth
No, I'm not change the colour depth.
-You have a zoom factor that is not 1 (100%)

Yes, nice, i need to change the zooma factor to adapt the picture in the box.

I attach the VI.

The problem not support a gif file and the resize picture don't work fine.

Thank's in advantage.

Download File:post-395-1122460638.llb

Download File:post-395-1122460665.llb

Link to comment
Thank's BArrie.

No, I'm not change the colour depth.

Yes, nice, i need to change the zooma factor to adapt the picture in the box.

I attach the VI.

The problem not support a gif file and the resize picture don't work fine.

Thank's in advantage.

5408[/snapback]

I think the problem is with the resizing. Resizing a digital image is not a trivial problem and some methods are more sophisticated than others.

Even equally sophisticated methods produce different results depending on the image content. For example, highly geometric images (such as a VI block diagram) can end up looking terrible, depending on how the image is resampled.

The LabVIEW zoom (or resizing) function provides no control over what resampling method is used, so you are stuck with what you have.

I noticed in your VI that the zoom factor you calculate is just about guaranteed to be non-integer. For example, even though you may be able to fit an image on the screen that is 100%, the VI will likely resize it to something like 99.2% or 101.5 %.

Resizing an image to a "nice" number (such as 1,2,4 or .5 or .25) can improve the situation significantly, again depending on the resampling algorithm. It's a question of trial and error with different values, and is dependent on the image content.

Some things you might try:

- Make a test VI where you can easily play with the zoom factor, using a slider and observe the results.

This will give you feel for how the resampling affects the image at different factors.

Then, in your VI:

- After you calculate the ideal zoom factor, coerce the factor to something less granular. For example: Coerce 105.2% down to 100% and coerce 49.1% to 50%

- If you must be able to see 100% of the image, change the size of the picture control to match the zoom factor, not the other way around.

- If picture quality is very important, you may be forced to use a third-party program to resample the image, but that can be messy and time-consuming.

I suspect that LabVIEW will be improving the graphics capabilities in the no-so-distant future, but for now you have to work with what you have. :(

Hope this helps,

Barrie

Link to comment
  • 2 weeks later...
Thanks i will wait NI, for improving graphics capabilities...

Nicola

5450[/snapback]

Which could be quite some time! Zooming pictures is not a simple thing. For instance using a bilinear interpolation works quite nicely for photo-like pictures but creates terribly blurry images for vector graphics such as a LabVIEW diagram, and besides it is rather computation extensive. Other algorithmes such as resampling the picture are reasonably nice for vector graphics but produce really bad artefacts for photo images when the zoom factor is not an integer multiple. The advantage of this algorithme is the computational speed of it.

Since NI does have a software package addon (IMAQ Vision) which can work very well with photographic images and has a large amount of options for zooming pictures, the need to add sophisticated zooming capabilities to the picture control is rather limited and therefore it is likely that many other more high priority features will be tackled first before this.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.