How to: Combining 16x16 bmp images into one bmp image

Ian Wood revlist at azurevision.co.uk
Mon Jun 4 04:54:00 EDT 2007


On 4 Jun 2007, at 03:54, Mark Stuart wrote:

> I have several existing (around 25-30) 16x16 bmp color images that  
> I would
> like to combine into a new bmp file,

Rev can't export BMP files, only PBM, GIF, JPEG or PNG.

> where I'd put the images in horizontal format - one line, one  
> directly after
> the other.

That's no problem at all.

> Is Rev able to do this? And if so, how would I write the script?

Something like:

answer folder "pick a folder of images"
   if it is not empty then
     put it into tFolder
   else
     exit to top
   end if
   set the defaultfolder to tFolder
   put the files into tFiles
   filter tFiles with "*.bmp"
   -- all of above replaced with routine to get list from database


   put 0 into tLeft
   repeat for each line tFile in tFiles
     if there is a file tFile then
       import paint from file tFile
       set left of last image to tLeft
       put right of last image into tLeft
     end if
   end repeat


Then you'd use the export snapshot command to save the whole lot as a  
single file.
There's no need to use a variable and work out complex concatenation,  
just use images on a stack that is off-screen or with the screen locked.

Ian




More information about the use-livecode mailing list