Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 1:47 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Alter images via opusscript
PostPosted: November 9th, 2004, 2:24 pm 
Offline

Joined: November 3rd, 2004, 11:08 am
Posts: 14
I have several images where the filename of those images are variables.
However in a page i have several rows of images with each row having the same variable in the filename.

Is it possible to alter this filename via opusscript or an alternative method?

Thanks


For this message DeMoN has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 9th, 2004, 2:54 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

If you want to permanently change the image which is displayed by these objects, you will need to open each image objects' properties and browse to the appropriate image files.

If, however, you want to change the image dynamically at runtime, due to a button being pressed or a condition being met, I would recommend using the SetImage() script function.

For example, if an Image object named Image_1 is currently pointing towards a variable named <image>, but you want this image object to point towards a variable named <picture>, use the following script action on a button:

Code:
Image_1.SetImage(picture)


You can also point the image object towards a file on the publication CD using the following syntax:

Code:
Image_1.SetImage(SYSTEM_PUBLICATION_DIR + "imagename.jpg")


I hope this helps. Please do not hesitate to contact me if you have any further queries.

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Image in preview vs publication
PostPosted: April 29th, 2005, 1:09 pm 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
I have a similar runtime requirement, viz. to display a customer or product logo whose name is held in an external ini file, and can therefore be varied for different situations using a single .exe.

Code:
[UserLogo]
Image=LogoGreen.gif
; or some other value


The code invoked with the page's OnShow action is:

Code:
{
   var strPath = "C:\\OpusTest\\Graphics\\"
   var strLogo = GetINIFileData( strPath + "General.ini", "UserLogo", "Image" )

   MyLogo.SetImage(strPath + strLogo)
   
   txtLogo.SetSelection(0, -1)
   txtLogo.ReplaceSelection(strPath + strLogo)
   txtLogo.Show()
}


In Preview, the designated image displays OK in MyLogo but in published form it is blank. txtLogo displays expected contents correctly in both situations.

Any insight please? Probably really simple as usual.....


For this message Linnet has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: April 29th, 2005, 1:58 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
It seems to be working fine for me. Please find attached a sample publication, .ini file and image which work correctly in preview and publish modes. For test purposes, I have set the strPath variable to SYSTEM_PUBLICATION_DIR, so the publication looks in the location from which it is running to find the .ini file. However, I have also used static paths (such as "C:\\Documents and Settings\\Rgarrett\\Desktop\\") and the publication still worked when previewed and published.

Could you please try extracting the files from the attached zip folder to a location on your hard disk and test to see if this publication works as expected?

Kind regards,


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

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 29th, 2005, 3:29 pm 
Offline

Joined: April 21st, 2005, 4:47 pm
Posts: 43
Location: Southampton, UK
Robin, thanks for your very quick reply. Your project ran as expected in both modes on my development machine too.

However, I think I have finally tracked the difference that made the difference: yours referenced a .jpg, which along with .png and uncompressed .bmp all seem to work, whereas mine referenced a .gif which fails as does RLE .bmp - both lossless compressions. Strange!

Best wishes
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: April 29th, 2005, 5:26 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

It is not possible to dynamically load in GIF images at runtime as we are not permitted to include the LZW library (which handles this format) in the Opus player file. However, there should be no problem with RLE-compressed bitmaps and I have attached a publication and images which demonstrate this (along with the GIF issue).

I would therefore stipulate to the client that the images should be in JPEG or BMP format or, if transparency is required, PNG format.

Kind regards,


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

_________________
Robin Garrett
Digital Workshop Technical Support


For this message Robin Garrett has been thanked by : mackavi


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 35 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