Photo Of The Day - Revisited

In this forum you can share tips and tricks on how to use Cinemar products with some program or a task that you want it to do. So no one has to reinvent the wheel if you already did! (No questions in this forum only solutions, questions will be deleted without hesitation.)

User avatar
ronsatter
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1304
Joined: Mon Dec 04, 2006 1:40 am
Location: San Leandro, CA
Contact:

Photo Of The Day - Revisited

Postby ronsatter » Thu Jan 28, 2010 2:09 am

Hi Gang,

I recently was asked how I changed the photos displayed on my Home Scene in the "Charcoal Series" package. It uses a technique outlined by Mario in this forum section called "Fun With Photo Of The Day". http://forum.cinemaronline.com/viewtopic.php?f=23&t=13037

There was a typo in the instructions which caused some problems, so I thought it might be a good project to re-post in a turorial for ML users. It is designed for new users, but even if you are an ML "Old-Timer" you might find this a nice addition to your scene design.

Here's how to do it:

The photos on my Home scene change every calendar day. They live in a folder named "MyPhotos" inside the "Images" folder inside the MLServer root folder.

Folder path is C:\Program Files\MLServer\Images\MyPhotos

The MyPhotos folder contains 31 jpg image files all with the same dimensions, named Day1, Day2, Day3 ... ect. See screenshot. Notice that my image size is 432 x 287. You'll need to use a graphics program to create copies of your photos at the size which fits your scene design. Try to use software which will save jpg images with little or no compression to maintain image resolution.

MyPhotos Folder View.jpg


Once you have the 31 images created and saved in the appropriate folder, create a new scene in ML with nothing on it ... completely blank. Name the scene "Screen Saver" and save it.

Select "Library" from the Edit Panel and add any object from library 0019. I'm partial to 0007, the round button.

Button Add.jpg


While in "Edit" in the "Button Mode" section of the ML Edit Panel, select the button object you just added to display the "Button Properties" panel.

Button Properties.jpg


In the JPG Image label field paste this file path pointer: http://{{server_servername}}:6246/getImage?Images\MyPhotos\Day{{currentdayofmonth}}.jpg and check the "Reload" box above the label.

Image File Path.jpg


Notice that there is a server variable in the label: {{currentdayofmonth}}. This dynamically is replaced by the number of the day of the month, so the appropriate image for the current day is displayed. That's why the images are named "Day1", "Day2" ... etc.

After you have entered your correct file path in the JPG Image label, click OK and you should see the round button image replaced by the image for the current day from your "MyPhotos" folder.

Current Day Image.jpg


Now the photo will change every day. You can always replace the photos with new images to freshen the library. Just be mindful to create all the images the correct size and name them correctly.

If you plan on using these photos as "Screen Savers", you could write commands which use MLTimer to navigate to the "Screen Saver" scene after a certain amount of time and dim the photo image (change the transparency level) after a certain amount of time.

You could make the photo object "Clickable" and add a command to navigate to your Home scene when the image is "Clicked/Touched" to remove it.

That's it ... and don't forget the most important part ... "Girls Rule" 8)

Ron
You do not have the required permissions to view the files attached to this post.
If it ain't broke ... don't fix it!

User avatar
ronsatter
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1304
Joined: Mon Dec 04, 2006 1:40 am
Location: San Leandro, CA
Contact:

Re: Photo Of The Day - Revisited

Postby ronsatter » Thu Jan 28, 2010 2:40 pm

The above post mentions setting the Alpha (transparency) level of the photo.

Here's the command for changing the alpha state of a button:

Code: Select all

MLCmd|{{clientname}}~setProperty|alpha~layer~aliasname~%

or in our screen saver example:

MLCmd|{{clientname}}~setProperty|alpha~0~DailyPhoto~50

In this example, "0" (zero) is the layer number. Zero is used if you have no other layers on the scene. The button alias is named "DailyPhoto" and the transparency is set to 50%.

To use this example on your "Screen Saver" scene, edit the photo object and type in "DailyPhoto" in the button Alias label field. Also uncheck the Reload box, or the photo won't keep the alpha dim setting because it is constantly reloading.

DailyPhoto.jpg


Now you can use the MLTimer plugin to issue the dim command after a certain amount of time. Remember to use a similar command to restore the alpha value to 100% when re-opening the scene, ie

MLCmd|{{clientname}}~setProperty|alpha~0~DailyPhoto~100

Scene Startup Options.jpg


PS - This last step is not really necessary, since the alpha level of the photo is not saved on scene exit. So the Alpha level will always return to 100%. I added the step as a precaution, in case the "Screen Saver" scene might accidentally get saved when the photo Alpha level was not at 100%.

Ron
You do not have the required permissions to view the files attached to this post.
If it ain't broke ... don't fix it!


Return to “Tips, Tricks and Tutorials”

Who is online

Users browsing this forum: No registered users and 1 guest