How to import an image on substack

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
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

How to import an image on substack

Post by samjith » Tue Apr 19, 2016 2:33 pm

Hi,

How to import an image on substack from my desktop and can able to view the imported image, when i increse the blend property of main stack.

I did it, but sometime the created substack height and width changes. i don't know why it happends
and
is there any way to zoom in and out the imported image in substack and also i need to lock the image to some point


Thanks

Samjith
Attachments
test.zip
(1.21 KiB) Downloaded 200 times

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: How to import an image on substack

Post by MaxV » Thu Apr 21, 2016 4:12 pm

I would use only this code on your button import:
########CODE#######
on mouseup
if exists (stack "Pic") then
answer "Image already exist"
else
lock screen
create stack "Pic"
go stack "Pic"
set the rect of stack "pic" to the rect of stack "test" #Why?
create image "image"
set the filename of image "image" to "/home/samjith/Pictures/1.png"
set the rect of image "image" to "0,0,50,50" # to zoom it
unlock screen
end if
end mouseup
#####END OF CODE#####
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: How to import an image on substack

Post by samjith » Sat Apr 23, 2016 3:06 am

thanks MaxV, i did it by instead creating substack by code.
set the rect of stack "pic" to the rect of stack "test" #Why?
i wan't to see the substack, when i change the blend propery of mainstack, like a transparent layer.
set the rect of image "image" to "0,0,50,50" # to zoom it
This is what i need.

Post Reply