Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 9th, 2024, 2:26 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Changing backgrounds
PostPosted: February 24th, 2006, 5:11 pm 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
I am supplying a single Opus project, configured with .ini files, to various groups of users. One group wants a different background from the others. Obviously one way round this is simply to introduce an extra, page-size graphic object (determined by reading in an .ini file value) & send it to the back of other objects. However is it possible to programmatically vary the background itself after publication?

Thanks, Linnet

_________________
A crack on the head / Is what you get for not asking
And a crack on the head / Is what you get for asking

Barbarism Begins At Home, The Smiths


For this message Linnet has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 24th, 2006, 10:21 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
I could see doing this one way. I created a frame as large as my page and left it empty without background or anything else. Then I made this a master page. On the master page I created an onshow action with a script action that did the following: f17.SetImage('c:\\pptback.jpg'). f17 is the name of the frame and the path stuff is where the image was. You can set the path and image programatically if needed, just take a look at the Opus Help files. You can also change to a background color/style if you want as well with SetBackground(), again, just check the Opus Help for more explanations/examples if needed.

What it does is change the "background" for the page upon opening. Now I will tell you that when you go between pages you see a flash while the script works, but you can probably get rid of this by checking for the existence of the image in the background, though I don't have the time/inclination to check at this moment.

Hope this helps.

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


For this message bwpatric has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 25th, 2006, 9:42 am 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
In the script help in Opus do a search for SetBackground()



Syntax:

SetBackground( ObjectName )

Parameters:

ObjectName – the name of an object that can contain any of the following properties:

Style – one of the Background styles you can create with this function. Style must be one of the following keywords: solid, linear, centre, circular, radial, spiral, spiral2, exponentialspiral or concentric. This property is optional. The keyword must be surrounded by quote marks or a variable containing one of the valid keywords.
Colour – the colour of the background. For a solid background style this is a single valid RGB value or a variable containing a valid RGB value. For any other gradient style (e.g. spiral) this is an array of RGB colour values – see example.

Note:
The RGB value can be calculated using the RGB function.
transparency – a percentage, showing the level of transparency for the background. transparency must be an integer between 0 and 100. This property is optional.
For non-solid styles, you can also set the following properties:
angle – the angle in degrees for linear, radial, spiral, spiral2 and exponentialspiral styles. angle must be a number between 0 and 359. This property is optional.

Note:
This property does not apply to centre, circular or concentric styles.
twist – the amount of twist to apply to spiral, spiral2 and exponentialspiral gradient styles. twist must be a number between 0 and 2. This property is optional.
bands – the number of bands for spiral, spiral2, exponentialspiral and concentric gradient styles. bands must be a number between 0 and 20. This property is optional.

offsetx – percentage from left to put centre of gradient for centre, circular, radial, spiral, spiral2, exponentialspiral and concentric gradient styles. offsetx must be a number between 0 and 100. This property is optional.
offsety – percentage from top to put centre of gradient for centre, circular, radial, spiral, spiral2, exponentialspiral and concentric gradient styles. offsety must be a number between 0 and 100. This property is optional.

startsize – the start size of the bands in spiral, spiral2, exponentialspiral and concentric gradient styles. startsize must be a number between 1 and 100. This property is optional.

Note:

All properties are optional and if they are not set, the SetBackground function will leave the property unchanged.

Remarks:

This function allows you to create the Background style and colour for a specified object by creating a new object and setting the properties you want to change. The new object containing your changes is entered in the objectName parameter and then applied to a specified object. There are two methods of using this function:

(i) Specify an object name – in this method, the Background style will be set on the Normal (i.e. default) Object State.
(ii) Specify a new object created with the GetAppearance function – in this method, the Background style is set for the Object State of the object specified in the GetAppearance function.

Note:

The Background style can be removed using the RemoveBackground function or in the Background tab of the object’s Properties dialog.


SetBackground()

Example 1:

To set the Background style on the Normal Object State for a Text object named Intro to solid with an opacity of 50% and a colour of blue, use the following syntax:

var new_style = new Object()
new_style.style = "solid"
new_style.colour = RGB(0,0,255)
Intro.SetBackground(new_style)

Example 2:

To set the same Background style as Example 1 above on the Mouse Over Object State for a Text object named Intro, use the following syntax:

var new_style = new Object()
new_style.style = "solid"
new_style.colour = RGB(0,0,255)
createEffect = Intro.GetAppearance("Mouse Over")
createEffect.SetBackground(new_style)

Example 3:

To set the Background style for a Text object named Intro to a 3 colour spiral (leaving the bands and offset as they were), use the following syntax:

var new_style = new Object();
new_style.style = "spiral";
new_style.colour = new Array();
new_style.colour[0] = RGB(128, 0, 0);
new_style.colour[1] = RGB(0, 128, 0);
new_style.colour[2] = RGB(0, 0, 128);
new_style.twist = 0.2;
Intro.SetBackground(new_style);

Note:

In Example 3, the colours are created using an array.

Example 4:

To rotate the angle of a background by 5 degrees, use the following syntax:

var new_style = new Object();
new_style.angle = 0;
while (true)
{
Frame_2.SetBackground(new_style);
new_style.angle += 5;
wait(0.1);
}




Hope this helps

Regards

Brenden Knifton ddww


For this message Brenden Knifton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 27th, 2006, 9:56 am 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
Thanks bwpatric and Brenden. I should have been clearer that this specific user wants to use an image (as .png or similar) rather than a generated solid/linear/etc background, which had seemed initially to rule out SetBackground(). I'll experiment with SetImage().

Regards, Linnet


For this message Linnet has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 27th, 2006, 11:20 am 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
Linnet,

I know one user who is using multiple backgrounds for a range of his customers.

The way we solved the problem was to usa a master page with a slideshow on it with different backgounds as the slides.

In the customers case, the end user had to log in and select their company. The master page had an if action to set the slidshow to the coreect slide based on what the user had entered. In youe case you could read the value in from an ini file.

Regards

Brenden Knifton ddww


For this message Brenden Knifton has been thanked by : mackavi


Last edited by Brenden Knifton on February 27th, 2006, 12:21 pm, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 27th, 2006, 12:14 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
Basic example attached.

Regards

Brenden Knifton ddww


You do not have the required permissions to view the files attached to this post.


For this message Brenden Knifton has been thanked by : mackavi


Last edited by Brenden Knifton on February 27th, 2006, 4:46 pm, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 27th, 2006, 3:40 pm 
Offline

Joined: November 5th, 2004, 6:54 am
Posts: 130
Location: Hengelo, The Netherlands
Opus: 8.5/9.0
OS: Windows 7 64-bits, Android 2.1, Android 4.1.2, iOS 7
System: Pentium 7i, 6GB RAM, 750GB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses
Hi Brendon,

After downloading I tried to open you zip-file but I get an error that the file is corrupt. Could you please upload another one?

Thanks in advance,

_________________
Oscar Nijst
ON Education & Consultancy
Hengelo, The Netherlands
OPUS Pro 9.5
Pentium 7i, 16GB RAM, 1 TB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses


For this message osni has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 27th, 2006, 4:49 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
My fault.

I needed to compress a zip file to maximum for a customer and WinZip remembers the settings.

File above should now work.

Regards

Brenden Knifton ddww


For this message Brenden Knifton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 27th, 2006, 5:14 pm 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
Thanks for the download - works also now for me! In the interim I'd set up a master page with a conditional background read from an .ini file, and a SetImage(). It looks as if this will do what's required, although like bwpatric I'm experiencing the problem of the delay/flash as each page loads. Fortunately I've got a few days to experiment....

Linnet


For this message Linnet has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 27th, 2006, 6:16 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
This attachment has less visable flash as it uses a blank slide as slide one.

Regards

Brenden Knifton ddww


You do not have the required permissions to view the files attached to this post.


For this message Brenden Knifton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 27th, 2006, 6:59 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
Try this one, should be no flash now.

It works by setting a variable as the background image name.

<SYSTEM_PUBLICATION_DIR><File>

were <File> is either image1.png or image2.png


Regards

Brenden Knifton ddww


You do not have the required permissions to view the files attached to this post.


For this message Brenden Knifton has been thanked by : mackavi


Last edited by Brenden Knifton on February 28th, 2006, 12:09 pm, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 28th, 2006, 12:04 pm 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
Hi Brenden

Had you intended to include another attachment in the last post ("... variable as background image name")?

In the end, I've decided to revert to the original plan (default image set on all pages; extra page-size image object, sent to back, included on each page; no reference to master page; read in required image name from .ini file on Welcome page - users always enter through this route - & store in publication variable; setImage on each page as part of OnShow action).

With the number of pages involved in this particular project, this isn't the biggest of overheads, and it also falls in line with other bits of local configuration. Good to have experimented with the various Master page options however, and hopefully this can be deployed in a future project. Thanks again meanwhile for your help.

Linnet


For this message Linnet has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: February 28th, 2006, 12:10 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
Sorry about that, I have now uploaded the file.
I must have closed the browser before the upload was complete.

Regards

Brenden Knifton ddww


For this message Brenden Knifton has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group