Example Code

Using a Picture Ring Control to Create an Animation Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview:
Demonstrates how to use the Picture Ring control to create an animated picture.

 

Description

This program shows how to animate a picture on the front panel using a picture ring (Pict Ring) control. The main VI (animation.vi) cycles through the included sequence of pictures, where each picture represents a "frame" of the animation. By programmatically incrementing the value of the picture ring, the picture appears to be animated. The speed that the ring increments can also be adjusted, making the animation slower or faster.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI. The Picture Ring displays frames sequentially to animate the image. The digital indicator to the right of the picture displays the current frame.
  2. Use the Frames Per Second slider to control the speed of the animation.
  3. Click the Stop button to quit.

 Additional Information or References

The Picture Ring in this example already contains the images the VI needs to animate the picture. Complete the following steps to add images to an empty picture ring:

  1. Place a Pict Ring control in the front panel window.
  2. Open the first image of the animation sequence in a picture editor and copy the picture to the clipboard.
  3. Right-click the Pict Ring control and select Import Picture from the shortcut menu.
  4. In the picture editor, open the next image in the sequence and copy it to the clipboard.
  5. Right-click the Pict Ring control and select Import Picture After from the shortcut menu.
  6. Repeat steps 4 and 5 to insert all the pictures in the sequence.
  7. Right-click the Pict Ring control and select Change to Indicator from the shortcut menu.
  8. Refer to the block diagram of this VI to see how to animate the Picture Ring.

**This document has been updated to meet the current required format for the NI Code Exchange.**

Product Support Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Jaggs
Member
Member
on

Just a suggestion -  You can create gif animated image from the frames using photoshop and then just customize the control using the gif image.  This way lot of additional code on the block diagram can be eleminated.

Hootowl
Member
Member
on

I am interested in this vi but am using 7.0.  Is it possible to get a version of the vi for 7.0?

Thanks, Hootowl

VeeJay
Active Participant
Active Participant
on
How did you create the picture ring in the first place? Please explain. Thanks!
I may not be perfect, but I'm all I got!
VeeJay
Active Participant
Active Participant
on
How did you create the picture ring in the first place? Please explain. Thanks!
I may not be perfect, but I'm all I got!
VeeJay
Active Participant
Active Participant
on
How did you create the picture ring in the first place? Please explain. Thanks!
I may not be perfect, but I'm all I got!
VeeJay
Active Participant
Active Participant
on
How did you create the picture ring in the first place? Please explain. Thanks!
I may not be perfect, but I'm all I got!