Code: Select all
import paint from file "c:\thumbnails\foo.jpg"
put name of ?????????? into tVar
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
import paint from file "c:\thumbnails\foo.jpg"
put name of ?????????? into tVar
Code: Select all
...
## Livecode ALWAYS uses the UNIX slash as a path delimiter:
import paint from file "c:/thumbnails/foo.jpg"
## This will put this into tVar: image "Image"
put the name of last img into tVar
## Maybe you want ot give a new name FIRST and then put that into a variabel:
set the name of last img to "the newly imported image"
put "the newly imported image" into tVar
...
Nice, but has nothing to do with the question!magice wrote:Look up Filename in the dictionary
My mistake, I misunderstood the question. That's what I get foe pre-coffee thread reading.Klaus wrote:Nice, but has nothing to do with the question!magice wrote:Look up Filename in the dictionary
No errormessage.Did you get an error? If yes, what does say?
Is the button "pict" on the same card as the new image?
That is of course the very best solution!robm80 wrote:Or I an resize the pictures in the file, from where they are importedIO
The image is placed OVER the button "pict", so it is not the icon of and likewise "set the icon of button "pict" to image "foo" is removed from the script.on mouseUp
delete last image
put "c:/newthumbnails/" into tStam
import paint from file tStam& fld "filefrom"
set the rect of last image to the rect of button "pict"
end mouseUp
Code: Select all
on mouseUp
set the lockLocation of btn 1 to true
answer file "Dude pick a picture" with type "JPEG Images|jpg|JPEG"
set the filename of img 1 to it
set the icon of btn 1 to the id of img 1
end mouseUp
Code: Select all
There is probably a cleaner way to do this.
Code: Select all
on mouseUp
delete last image
put the filename of this stack into tVar
put char 1 to 12 of tVar & "thumbnails/" into tStam ------- now any user who has a directory "thumbnails" placed in the stack's directory may use this script
import paint from file tStam& fld "filefrom"
set the rect of last image to the rect of button "pict"
end mouseUp
Which script?but with this script I get all I want.
Hi Simon,Which script?
Is everything ok now? Problem solved? Question answered? Am I still missing the point?
What do you exspect? When you create a new object, that new object will ALWAYS have the highest layer (= on top of everything).robm80 wrote:With this:The image is placed OVER the button "pict", so it is not the icon...Code: Select all
on mouseUp delete last image put "c:/newthumbnails/" into tStam ## ALWAYS use parens when concatenating object- and filenames! import paint from file (tStam & fld "filefrom") set the rect of last image to the rect of button "pict" end mouseUp
??? I did not remove anything!... and likewise "set the icon of button "pict" to image "foo" is removed from the script.
Because that line is missing from your scriptWhy no icon?