Images within lists

Sannyasin Sivakatirswami katir at hindu.org
Tue Dec 17 23:10:01 EST 2002


Aloha, Jez from Hawaii:

Have been working on this  and succeeded with this "hack":   created a 
field and filled down with numbers: You have to set the imageSource of 
characters in the field, and for them to flow properly each one must be 
followed by a cr/return

1
2
3
4
5
etc. to as many as you think you might ever load (I put 1- 1000 but 
never actually loaded more than 100 images into a field.)


then, by script you can set the imageSourse of char 1, 3,5 etc. on 
lines 1,2,3 etc.

Note that should one enter text following the image, the script would 
break if you tried to reapply it as it is dependent on the field 
content being a strict ordinal sequence of numbers followed by a line 
break. Well, actually the images will load, but they will occupy 
characters in your text and run to the right off the field. Images 
"obey' the cr which acts just like

<br clear="left"> in html.


That's as far as I got so far, script is below and if you want a copy 
of my "image manager" stack i can send if off list.

Did you figure out how to make thumbnails for larger images from within 
Rev itself? Or are you getting those out of some other application?

========
global gCurrentFolder

     ##  absolute path to your directory of images.

on mouseUp

  set the lockscreen to true -- speeds things up a bit

## First get a list of offset locations of each number which is on its 
own line,
## the cr is a character also but can never be the content of a line
## so you just get the offset of the numbers by stepping through the 
lines.

   repeat for each line x in fld "imageField"
     put offset (x,fld "imageField") & cr after charPositions
   end repeat

## the above could be easily adjusted to allow for three CR's between 
each
## line containing a number making it easy to cursor in to enter text)
## just enter the number into the field like that, then put the number 
into a
## variable each one follow by a cr and step through the lines of the 
variable instead of the field
## "Repeat for each line x in tNumberList; put offset (x, fld 
"imageField") etc...

## Now, clean out the previous imageSource data
## so that no images from a previous list are left at the end
## if the current list is shorter than the previous list of files.
## it takes time for the stack to open if it has to set a large amount 
of
## imageSource data....

repeat for each line y in charPositions
    if the imagesource of char y of fld "imagefield" is not empty then
         set the imageSource of char y of fld "imageField" to empty
    end if
end repeat


   ## now set the imageSource for all the characters
## for as many files as you have, in the case my file list is in
## another field from which I can view each full res image one at a time
## as needed (and rotate, delete, copy,  move to other directories as 
needed)

## Oh, be careful, if  you run this on a directory of hi-res digitals 
it will indeed do it,
## but assuming you have memory enough not to crash, will take forever!

   put fld "fileList" into theFiles
   put 1 into nextImage
   repeat for each line y in charPositions
     if line nextImage of  theFiles is not empty then ## in case your 
list has empty lines at end
       put (gCurrentFolder& (line nextImage of theFiles)) into tPath
       set the imageSource of char y of fld "imageField" to 
("binfile:"&tPath)
            ## this does the actual image loading, where "y" is the 
offset location of the next number)
       put nextImage+1 into nextImage ## step through image file list
      else  ## done, no more files
       exit mouseUp
     end if
   end repeat

end mouseUp


Hope that helps. keep us posted if you have any break throughs... I 
need a method to keep images and captions together also, and to allow 
collaborative captioning of images by different people on the LAN 
during the same time frame i.e. if images arrive I want to get 2-4 
people working on captions all together in the next 40 minutes and have 
them be updating "live" on each other's screens as they work.  I didn't 
think I could wire the field to do this easily and have opted to go a 
different direction which will be a group of image controls and caption 
fields in a scrolling group. That's very doable, with one challenge:  
how to re-order them on the fly where I want to move say, photo 3 and 
its caption to position 6  which is "down" vertically in the group...

On Tuesday, December 17, 2002, at 11:39 AM, Jez wrote:

> Can I embed images within a scrolling list field ? I really want a 
> combination of text and thumbnail in each list entry. Any advice 
> appreciated thanks.
>
Sannyasin Sivakatirswami
Himalayan Academy Publications
at Kauai's Hindu Monastery
katir at hindu.org

www.HimalayanAcademy.com,
The Complete Text of the monumental work
Merging with Siva, Hinduism's Modern Metaphysics
now on-line:
http;//www.himalayanacademy.com/books/mws/




More information about the Use-livecode mailing list