08-07-2008 04:07 AM
08-07-2008 07:39 AM
08-07-2008 07:50 AM - edited 08-07-2008 07:51 AM
I never found a method to CONTROL gif's.
In post #94 of this thread I posted some code that was a community project to allow easy inclusion of emoticons into forum postings. It has a an Import function that lets you grab images from gif's and adds them to a palette from which you can choose your emoticon. You may wat to review that thread for the code and the associated instructions since I beleive some of the techniques I used in that code code be of use to you.
Take a look at the code that does the Import.
Take care,
Ben
08-19-2008 12:55 PM - edited 08-19-2008 12:56 PM
Hi eyal,
you can read the gif file as binary data and create the different images which are in this file to show them in labview, maybe in a picture ring. You can then use a loop to show it. You can also read the time between the single pictures to connect it to a wait function. If you are able to show all pictures in a picture ring then you can use events to start or stop the animation.
Hope it helps.
Mike
08-20-2008 07:48 AM
Mike wrote
"you can read the gif file as binary data and create the different images which are in this file to show them in labview, ..."
I have never cracked that nut. Do you have code that will read (or even better write) a gif?
Ben
08-20-2008 07:52 AM - edited 08-20-2008 07:54 AM
Hi Ben,
i´m currently writing a code to read gif files. I need some more tests and if i´m ready i will post it here. I know your icon consists of 4 states. I think a can post it at weekend.
Mike
08-20-2008 08:28 AM
Mega-stars for you Mike!
That would make a nice Nugget.
Ben
08-20-2008 11:33 AM
Image Toolbox support read/write gif file.
http://www.geocities.com/gzou999
Animated gif has a different file format though.
08-21-2008 07:57 AM
I have personally used a pict ring for controlled animation. It works very well (my first effort was the electric discharge on the load screen of the NI-SCOPE Soft Front Panel, version 1.0). The major problem to using this is that there does not appear to be a programmatic way to load the images. This limits its usefulness to about ten frames (depending on your patience), but I have never really needed more than that.
As mentioned earlier, you control this by changing the value of the pict ring in a time fashion. Event timeouts or a timed loop would probably work best. I did this so long ago I used a while loop and delay.
Note that if you use an animation while loading code from disk (i.e. a load screen), you should load your code bottom up and one VI at a time to allow the UI time to animate your image. Otherwise, the UI thread will be essentially locked out by the load, leading to no real animation.
08-22-2008 03:20 AM
Hi eyal,
attached you will find the vi´s which shows what i meant. Open the Gif.Example.vi.
Hi Ben,
it´s not a nugget, but here is the code.
I write also a LV71 version, i will upload it soon.
Hope it helps.
Mike