using specialfolderpath("engine") as source of image

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
prexsoccer
Posts: 29
Joined: Fri Jun 08, 2012 9:54 am

using specialfolderpath("engine") as source of image

Post by prexsoccer » Wed Oct 03, 2012 3:49 am

i have a lot of image to be use, and I think importing it to the stack will hang the app up, so maybe i can use the specialfolderpath("engine") function.
now the problem is I dont know how to use image using that path, image for my buttons. I was able to use specialfolderpath("engine") & "/sounds/" for my audio clips but i have problem using the the image.

set the icon of btn "backgroud" to specialfolderpath("engine") & "/pictures/bgimage.png"

i dont think the statement above is correct :) :D :mrgreen: and would return the path of the image I want :).

can anyone help me with this one?
thank you.

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: using specialfolderpath("engine") as source of image

Post by Klaus » Wed Oct 03, 2012 10:42 am

Hi,

as the dictionary clarely states, you can only use the ID or the NAME
of an (already imported!) image as an icon of a button.

Using the FILENAME of an image does not work.


Best

Klaus

prexsoccer
Posts: 29
Joined: Fri Jun 08, 2012 9:54 am

Re: using specialfolderpath("engine") as source of image

Post by prexsoccer » Wed Oct 03, 2012 3:21 pm

hi klaus,

so my only option is to import all images in the stack?

But the problem I encounter last time in using lot of images is that it freeze the app in a while.
is there any solution for this?

thank you for you help klaus.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: using specialfolderpath("engine") as source of image

Post by jmburnod » Wed Oct 03, 2012 6:48 pm

Hi prexsoccer

Is it necessary to use buttons to show all pictures ?

Jean-Marc
https://alternatic.ch

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: using specialfolderpath("engine") as source of image

Post by Klaus » Wed Oct 03, 2012 9:07 pm

Hi prexsoccer,
prexsoccer wrote:hi klaus,

so my only option is to import all images in the stack?
If you want to display them in a button as ICON, YES.

Maybe you can use "just" images?
In that case you can set the filename of an image object.
prexsoccer wrote:But the problem I encounter last time in using lot of images is that it freeze the app in a while.
How many images are we talking about?
prexsoccer wrote:is there any solution for this?
Depends on what you want to achieve! 8)
If not all images are shown at once, you could surely use image objects and set their filenames dynamically = when you need it.


Best

Klaus

prexsoccer
Posts: 29
Joined: Fri Jun 08, 2012 9:54 am

Re: using specialfolderpath("engine") as source of image

Post by prexsoccer » Fri Oct 05, 2012 8:30 am

hi klaus,

i really appreciate your help :)

ahmmm, I have a bunch of image to use like a thousand images :). I use it for animation purposes.
I made 1 app already for this and its in appstore. its dodong ebook. its made of loads of images to animate its scene. thats why I encounter freeze on it. if you have time, you can check the app and maybe you can help me on the problem :) or perhaps a good solution. 8) 8)

:)

thank you.

best regards,
mike

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: using specialfolderpath("engine") as source of image

Post by Klaus » Fri Oct 05, 2012 11:59 am

Hi Mike,

no, I don't have time to check your app, but maybe I can give you some hints.
The first one may not apply, since I don't know anything about your animations!

1. use a movie (mp4 or whatever iOS supports) for "static" animations instead of images, if this is possible!
2. do only load the images that you need for the (or all) animation(s) on the current card!
Setting the filename of images in a "repeat" loop is fast enough for this.
3. this (2.) requires a smart "image management concept", which is essential for your needs.

Know what I mean?
Like creating a list of images (filenames) for each animation and dynamcially load the neccessary images.


Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”