Using Resources of Another Book

Question: I want to use a system book as a source of my images. Is this possible?

Answer: This is definitely possible. I have included some code from our Plug-In Pro below that should help. The main idea is that you want to check to see if the resource is already there. If so, either use it or call replace resource. If not, you want to use import bitmap resource. In the code below, callingBookId would refer to your system book. You could get your hands on that by using sysBooks. For example:

callingBookId = book (item 1 of sysBooks)

Here is the code I mentioned.

shortName = chars max(1, maxChars - 31) to maxChars of fullImageFile 
tempRef = "bitmap" && quote & shortName & quote && "of" && callingBookId 
oldImageRef = normalGraphic of placeholderId 
if isObject (tempRef)
        replace resource tempRef with imageFile
        normalGraphic of placeholderId = tempRef
        errString = ASYM_RestoreSuspend(blkSus) 
        import bitmap resource imageFile as shortName
        normalGraphic of placeholderId = bitmap shortName
        errString = ASYM_RestoreSuspend(blkSus) 
end if

About Jeff Rhodes
Jeff Rhodes is the Chief Technical Officer and owner of Platte Canyon Multimedia Software Corporation, a leader in developing commercial software that Improves the Lives of Training Developers. He graduated at the top of his class at the Air Force Academy, where he earned a Bachelor of Science in Electrical Engineering. Jeff received a Masters degree in Economics from the London School of Economics, which he attended under a British Marshall Scholarship. Jeff is the author of "Programming for e-Learning Developers: ToolBook, Flash, JavaScript, & Silverlight" and "VBTrain.Net: Creating Computer and Web Based Training with Visual Basic .NET." He also co-wrote "The ToolBook Companion." He has had numerous articles on training development published and is a frequent presenter at conferences both in the U.S. and Europe. Jeff lives in Colorado Springs with his wife Sue and sons Derek and Michael.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: