Placing image from iPhonePickPhoto

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
grovecat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 99
Joined: Thu Aug 04, 2011 10:32 am

Placing image from iPhonePickPhoto

Post by grovecat » Thu Nov 17, 2011 10:54 am

I have created an image object ("thePhoto"), into which I want to place the photo chosen via the iPad (in this case) photo picker. Using this bit of code:

on mouseUp
iphonePickPhoto library 440, 330
put the last image into the image "thePhoto"
end mouseUp

Now this does the job exactly, but it also puts a copy of the photo in the centre of the screen. I can't find a way to prevent this happening or deleting the extra copy. I'm sure there is a very simple solution ...

TIA
Don

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Placing image from iPhonePickPhoto

Post by Klaus » Thu Nov 17, 2011 11:22 am

Hi Don,

well, that's the way it works!
"iPhonePickPhoto" does always create a NEW image on the current card, get used to it 8)

I would do something like this:

Code: Select all

on mouseUp
  if there is an img "thePhoto" then
     delete img "thePhoto"
  end if
  iphonePickPhoto library 440, 330
  set the name of last img to "thePhoto"
end mouseUp
Noone will tell the difference! :D


Best

Klaus

grovecat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 99
Joined: Thu Aug 04, 2011 10:32 am

Re: Placing image from iPhonePickPhoto

Post by grovecat » Thu Nov 17, 2011 12:36 pm

Thanks again Klaus.

Cheers
Don

Post Reply