Jump to content

Faster loading of pictures


Recommended Posts

Hello Everyone.

In my vi-application, i am using some images, that are loaded using "load jpg"/"load png"-functions. Now everytime i load an image, this takes too much time (for my needings; pictures are 600x256px big.)

It gets even slower, when i write to the picture-control using the reference (from inside a subvi).

I was thinking about storing the images in the final exe. Is that possible? And how would i go about to load the pictures then?

thnx in advance.

Link to comment

not static images. I need to change them.

explanation: i built a function, that would draw a list of items onto an image and select one of them. Select means, that it would put a box around the item with a background and change the item's color.

So to that function i pass a background image, the items (as a array of strings) and the colors. The function returns the new image (possibly the list has to be displaced, so that the selected item is still visible...). So everytime the user presses arrowdown for example i would pass a pos+1 to the function and the next item will be selected. Then i route the output image to a picture-control. As i said before, the picture is 600x256px big.

The first time the picture is loaded it needs about a second or two to load. After that it's much faster but still not fast enough. When you go down in a listing, you wouldn't expect to see the picture flash...

Please tell me, if that's still not clear.

thnx.

Link to comment

Merlin,

Did you try the picture ring for your purposes? There you embed the images directly into the control (at design-time) and select the desired picture by index at runtime. It is located in the Ring & Enum palette.

Select Image by Image from Menu>>Import Picture from File and then with RMB on the control select Import Picture on the desired ring item.

Didier

Link to comment
Merlin,

Did you try the picture ring for your purposes? There you embed the images directly into the control (at design-time) and select the desired picture by index at runtime. It is located in the Ring & Enum palette.

Select Image by Image from Menu>>Import Picture from File and then with RMB on the control select Import Picture on the desired ring item.

Didier

4027[/snapback]

Hi,

thank you, that seems to be exactly what i need. Problem is still, that i'm not able to read the pictures, but i hope this will sort itself out.

thnx again.

merlin

Link to comment
  • 3 weeks later...

Hi,

Try this VI all you need to do is supply the image path, which can be static or dynamic.

The problem I have found with picture rings is trhat when you have many pictures the llb file gets very big and it takes quite a while to load the program because it has to cache all of the images.

If you use my vi the pictures are loaded as jpegs as required by your main level VI.

Enjoy!

Al

Download File:post-1633-1111165831.vi

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
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.