Import as Control - Image File (Stack problem?)

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
xeir
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 35
Joined: Thu Jul 03, 2008 5:54 am

Import as Control - Image File (Stack problem?)

Post by xeir » Sun May 31, 2009 3:38 am

Hoping someone can help here.

I'm trying to embed some images/icons in my stack to no avail.
I've followed the information here: http://forums.runrev.com/phpBB2/viewtop ... image+file, tried all 3 options.

Step 1 shows up, but I don't want a referenced image.
Step 2 & 3 do not show up, they just appear as a blank bounding box.

Out of curiosity, I tried this with a new stack and it worked fine. This is pointing to possible corruption or some setting that is causing an issue.

If anyone has some insight, I would be most grateful as I am nearing release of the App I've been working on and just trying to get everything in order.

Regards!

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sun May 31, 2009 1:19 pm

Hi xeir,

I made a little handler for me some time ago, that will import
all referenced images of every card in a given stack!

This way you can work with refernced image during development
and then run this script before you create a standalone.

I use it all the time and it works fine :-)
Simply call it with the stack name as a parameter:
...
import_all_ref_images "My stack with referenced images"
...

Code: Select all

command import_all_ref_images the_stack
  set the defaultstack to the_stack
  lock screen
  lock messages
  repeat with i = 1 to the num of cds
    set cursor to busy
    repeat with k = 1 to the num of images of cd i
      put the filename of image k of cd i into tFilename

      ## This image has already been imported!
      if tFilename = empty then 
           next repeat
      end if

      ## Import the image into the image object
      put url("binfile:" & tFilename) into image k of cd i
    end repeat
  end repeat
  unlock screen
  unlock messages
  answer "Done!" & CR & "Don't forget to save stack" && QUOTE & the_stack & QUOTE & "!"
end import_all_ref_images
Hope that helps!


Best

Klaus

xeir
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 35
Joined: Thu Jul 03, 2008 5:54 am

Post by xeir » Sun May 31, 2009 5:05 pm

Klaus-

I appreciate the snippet of code and eagerly tried it out.
Hard as this may be to believe, It still doesn't work. This is baffling me.

The referenced images that showed up before, after running the script, no longer show up when compiled.

It's almost as if there is a setting that got inadvertently set that doesn't allow images in standalone mode :? or I'm simply forgetting something extremely basic here.

I tried this in a new stack, first time it didn't work, second time it did. Must have been a hickup or something.
Tried it in my app again, still no luck.
I am truly at a loss on this.

Here's an image of the compiled app just to show what is going on:
Image
The images are showing up in the development environment however.

Squares:
Top left - was a referenced image until your script was ran.
Bottom left - import as control image
Both on the right - reference the other 2 images

Hmm..

Btw, guess I should mention this, developing with:
Rev Studio on OS X version 3.5.0 Build 860
This is affecting both the OS X & Windows build of the App.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Mon Jun 01, 2009 11:11 am

Hi xeir,

I have not the slightest idea what's going on there?!!! :-/

You could send me the stack (a stripped down version) and the images
and I could take a look if you like:
klausATmajor-k.de


Best

Klaus

xeir
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 35
Joined: Thu Jul 03, 2008 5:54 am

Post by xeir » Thu Jun 04, 2009 8:04 pm

Klaus-

I'll strip down the App and send it along in the next few days. Been trying to recover form the latest stress in trying to get the app ready, grin.

I have NO idea why it's acting like it does, so it could be something simple, it could be something as massive as having to manually re-create the stack and move everything over, which I hope is not the case.

Regards!

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Jun 04, 2009 8:46 pm

Hi xeir,

please do NOT send me a standalone, just the stack(s) and the images!

xeir
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 35
Joined: Thu Jul 03, 2008 5:54 am

Post by xeir » Thu Jun 04, 2009 10:44 pm

Klaus wrote:Hi xeir,

please do NOT send me a standalone, just the stack(s) and the images!
Grin, wouldn't dream of it.

I'm still trying to let the tension and stress fade from a long run of programming. It's pretty bad when your body says you've had enough.

Once I've recouped enough to actually sit in front of the system again for any duration, I'll pop that along to you. Right now it's just an on again off again again thing. Prolly be a day or two.

Even typing now, I told myself I wouldn't do. So much for that.

Need to find me a virtual masseuse!

Till then ..

xeir
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 35
Joined: Thu Jul 03, 2008 5:54 am

Post by xeir » Sun Jul 12, 2009 5:44 pm

Well, I'm back after dealing with a lot of other things going on. Isn't that always the case.

I did find the solution to this problem however.

'Copy Referenced Files' was checked in the 'Standalone Application Settings' and this was apparently causing the issue.

So, all is good and working as it should once more.

Just thought I would post in case someone else has the same problem with imported graphics/pictures not showing up.

Regards!

Post Reply