Cannot Rotate Image

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
Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Cannot Rotate Image

Post by Googie85 » Mon Jul 23, 2018 8:28 pm

Hi Guys!

I have the following code and I cant get it to rotate and save a camera photo to a file:

on mouseDown
put the field "Time" into timevar
set the defaultFolder to "/mnt/sdcard/"
create folder ("Archery Stats")
set the defaultFolder to "/mnt/sdcard/Archery Stats/"
create folder ("/mnt/sdcard/Archery Stats/"&timevar)

put the long time into dae
put "binfile:/mnt/sdcard/Archery Stats/"&timevar&"/"&dae&".jpg" into temppath

mobilePickPhoto "front camera", 250,600
put the last image into URL temppath

put URL temppath into image "temp"
set the angle of img "temp" to 90
export img "temp" to file temppath as JPEG

end mouseDown

Any Help Would Be Appreciated!

Googie.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Cannot Rotate Image

Post by dunbarx » Mon Jul 23, 2018 9:51 pm

Hi.

Are there two separate problems here? Is there a valid image when you "mobilepickPhoto"?

If so, does the image not rotate?

If so, then does the image not get "put", or does it not "export"?

Craig Newman

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Cannot Rotate Image

Post by MaxV » Wed Aug 29, 2018 11:29 pm

Just use this:

Code: Select all

...
set the angle of img "temp" to 90
set the imagedata of image "temp" to the imagedata of image "temp"
export img "temp" to file temppath as JPEG
...
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”