Embedding images in fields - ideal design ?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Embedding images in fields - ideal design ?

Post by Simon Knight » Sat Oct 12, 2013 9:55 pm

I wish to build an application that allows the user to add images to text notes in a notebook like app. I have been searching the web and reading the documentation and believe that I have a basic understanding of how to get images into and out of a Livecode application but I am not sure of the best approach for storing the images.

At present I plan that the text of the notes will be stored in a delimited text file which gets updated as the application is run. The app will allow images to be drag dropped into the application, then they will copied out to a dedicated folder used to store the applications assets. Once they have been written out the text of the note will be linked to the image file and the file name of the image and its character position in the field will be stored in the delimited text file.

Is my plan sound ?
best wishes
Skids

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Embedding images in fields - ideal design ?

Post by Simon » Sat Oct 12, 2013 10:01 pm

Hi Simon,
Like using an external file that you update you can use a stack as well.
The cool thing about using a stack is that you can store binary files in it.

If I understood you correctly then you could/should be using the Splash Stack method.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: Embedding images in fields - ideal design ?

Post by Simon Knight » Sat Oct 12, 2013 10:13 pm

Hi Simon,

So I would have to use a splash stack so that I am able to save my main stack and sub stacks when running as a stand alone. Would it just be a case of importing each image onto a hidden substack?

Simon
best wishes
Skids

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Embedding images in fields - ideal design ?

Post by Simon » Sat Oct 12, 2013 10:22 pm

Hi Simon,
Here is the splash stack lesson:
http://lessons.runrev.com/s/lessons/m/4 ... pplication

In short no, you don't use a hidden stack just a "normal" stack.
The big difference is your "real" application is never built into a standalone and can remain a .livecode/.rev/.whatever_you_want, you may know a standalone can't save new info in them but a stack can.
Only the stack that launches your main stack is a .exe or .app.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply