LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Picture Ring problem !

Hi all,

I have created a child panel "panel5" beside main panel "panelHandle" and put inside a Picture Ring control with four pictures (their indexes are 0,1,2,3 ) for animation...

When there is a function called, it will display panel5 and the animation will start. But when I run my code, it was stationary :(. Could you guys advise me on where my mistake was ? Thx thx a million time.


        LoadPanel (0, "fyp.uir",4 ); // Load panel5 in memory
           
        SetPanelAttribute (panelHandle, ATTR_VISIBLE, 0); // Set invisibility for panelHandle
  
        SetPanelAttribute (panel5, ATTR_TITLE, "Loading MCQ data !"); // Set title of panel 5
       
        // Convert and set attributes for Picture Ring

        AnimateCtrl_ConvertFromPictRing (panel5, PANEL5_PICTURERING);
       
        AnimateCtrl_SetAttribute (panel5, PANEL5_PICTURERING, ATTR_ANIMATE_ENABLED, 1);
             
        AnimateCtrl_SetAttribute (panel5, PANEL5_PICTURERING, ATTR_ANIMATE_FRAME_INTERVAL, 1);

        AnimateCtrl_SetAttribute (panel5, PANEL5_PICTURERING, ATTR_ANIMATE_STOP_ON_LAST_FRAME, 0);

       // end setting

        DisplayPanel (5);  //display panel5

        SetPanelAttribute (panelHandle, ATTR_VISIBLE, 1);
       
        HidePanel (panel5);   
0 Kudos
Message 1 of 2
(3,241 Views)
Hi Mavn2002,

I made a very brief program on my end and was able to see my picture ring "spinning".  Here is the code snippet which most applies to your application:

    panelHandle = LoadPanel (0, "Test.uir", PANEL);
   
    DisplayPanel (panelHandle);
   
    AnimateCtrl_ConvertFromPictRing(PANEL, PANEL_PICTURERING);
   
    AnimateCtrl_SetAttribute (PANEL, PANEL_PICTURERING, ATTR_ANIMATE_ENABLED, 1);
             
    AnimateCtrl_SetAttribute (PANEL, PANEL_PICTURERING, ATTR_ANIMATE_FRAME_INTERVAL, 1);

    AnimateCtrl_SetAttribute (PANEL, PANEL_PICTURERING, ATTR_ANIMATE_STOP_ON_LAST_FRAME, 0);

    RunUserInterface ();

I hope this helps!
Matt S
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(3,196 Views)