iphonePickPhoto frustration

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

iphonePickPhoto frustration

Post by Kaubs » Sat Jul 09, 2011 8:58 am

I have been beating my head against this one for a few hours now...

Code: Select all

on opencard
    iPhonePickPhoto "rear camera",  600, 600
    if the result = "cancel" then
       exit opencard
    end if
    iphoneExportImageToAlbum (the number of images)
    
end opencard
Is it just plain impossible for livecode to resize the image to a square? I understand the iPhone is not taking a square picture but if you specify parameters it just resizes the image based off of a rectangle anyways? Is there no way to specify where the image dumps to or will it always just plop in the middle of my screen?

Thanks! Much appreciation for any help!

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

Re: iphonePickPhoto frustration

Post by Klaus » Sat Jul 09, 2011 9:50 am

Hi Kaubs,

maybe a look into the "iOS Release Notes" would have saved you a lot of time?! 8)
"iphoneExportImageToAlbum" requires binary data as a parameter and not a numbver!

Code: Select all

on opencard
    iPhonePickPhoto "rear camera",  600, 600
    if the result = "cancel" then
       exit opencard
    end if
    iphoneExportImageToAlbum the text of last img    
end opencard
Best

Klaus

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

Re: iphonePickPhoto frustration

Post by Klaus » Sat Jul 09, 2011 12:13 pm

Hi Kaubs,

addition...
Is it just plain impossible for livecode to resize the image to a square?
Not per se!
I understand the iPhone is not taking a square picture but if you specify parameters it just resizes the image based off of a rectangle anyways?
Obviously LiveCode will ALWAY preserve the correct aspect ratio.
But noone will prevent you from resizing the last image AFTER you imported the photo, which should work nicely with a LOCK SCREEN!
Is there no way to specify where the image dumps to or will it always just plop in the middle of my screen?
From the iOS Release Notes:
Note: The image object is cloned from the templateImage, so you can use this to configure settings before calling the picker.

So maybe a:
...
set the LOC of the templateimage to 10,10 ## or wherever!
IPHONEPICKPHOTO...
...
might help?


Best

Klaus

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: iphonePickPhoto frustration

Post by Kaubs » Mon Jul 11, 2011 6:26 pm

Ok....so this worked out pretty well.

Code: Select all

on opencard
   set the lockloc of the templateimage to true
   set the height of the templateimage to "450"
   set the width of the templateimage to "430"
   set the top of the templateimage to "155"
   set the left of the templateimage to "105"
   
   iPhonePickPhoto "rear camera"
   if the result = "cancel" then
      exit opencard
   end if
   
end opencard
My only problem now....my image takes about 15 seconds to show up on the screen and when it does it's sideways.....Any clue? Thx!!!!

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

Re: iphonePickPhoto frustration

Post by Klaus » Mon Jul 11, 2011 7:32 pm

Hi Kaubs,

sorry, no clue, I only have an old iPod Touch without a camera.

But try this (wild, wild guess :D )

Code: Select all

on opencard
   set the lockloc of the templateimage to true

   ## Numbers NOT in Quotes!
   set the topleft of the templateimage to 105,155
   
   iPhonePickPhoto "rear camera",430,450
   if the result = "cancel" then
      exit opencard
   end if   
end opencard
Best

Klaus

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: iphonePickPhoto frustration

Post by Kaubs » Mon Jul 11, 2011 9:08 pm

Klaus,

You read my mind. It dawned on me shortly after posting. Works perfectly. Ive now found that if you specify image size before invoking iPhonepickphoto performance is terrible.

Thanks!

Post Reply