Graphics

 View Only
  • 1.  Auto-changing photo slides

    Posted 04-05-2016 22:03
    Hi all,

    I want to create a full page graphic that displays a new photo every 10 seconds.
    I have a folder of 100 images labelled in numerical order (1.jpg, 2.jpg, etc). I know how to link these images to the scene, but I'm wondering how to generate a random number from 1-100 and assign that number to the picture to display it.

    This is what I have so far, copied from another slide that was set up by my Ross instructor when we got the system:

    dim picture as xpbaseobject
    scene.getobjectbyname("IMAGE", picture)

    dim path as string
    path = "D:\MOOSE 2015\Images\SLIDESHOW"

    if scene.iscopy then

    picture.setvolatiletexturefile(0, path & text & ".jpg")
    end if

    Any help would be greatly appreciated!


  • 2.  RE: Auto-changing photo slides

    Posted 04-06-2016 08:20
    In your scenedirector, put a script event with your script at 10sec, just after, put an event to go back to frame 1.

    dim picture as xpbaseobject
    scene.getobjectbyname("IMAGE", picture)

    dim path as string
    path = "D:\MOOSE 2015\Images\SLIDESHOW"

    Dim r As Random = New Random
    text = r.Next([I]0[/I], [I]101)[/I]

    picture.setvolatiletexturefile(0, path & text & ".jpg")


    Not front of an Xpression to test, but code seems to be like this
    #XPression


  • 3.  RE: Auto-changing photo slides

    Posted 04-06-2016 21:23
    That worked! Thank you very much.
    I created a new group with 2 slides and set a timer to loop the slides every 10 seconds.

    The transitions are kind of slow because I think the random number generator is constantly working but this is a huge help.
    Thanks!
    #XPression