I am trying, as login process of my standalone, to let the user shot or load his photo, making a round PNG image out of it.
A PNG because, at the end of the job, I would like to have a alpha transparent background that show only the circle with the photo on it.
I've got some code and ispiration here:
http://forums.livecode.com/viewtopic.ph ... 80#p135480
viewtopic.php?f=7&t=31825&start=15
As of now, on OSX only, I can load an image, resize it, move it.
My problem is taking a snapshot of the result: somehow the snapshot doesn't work. Not to talk having an image with alpha channel (wich I don't really understand).
Any suggestion or stack improvement is welcomed.
Trevix
Make a round photo icon for OSX and Mobile
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Make a round photo icon for OSX and Mobile
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
Re: Make a round photo icon for OSX and Mobile
Hi trevix
Today I created a thread wondering why the roundRadius property is not present in groups. Now I see that it would also be nice if the images had it.
The problem you are facing I have already faced and here is the solution I found.
The code is on the stack that I attach.
look at the exportSnapshotPNG command
Today I created a thread wondering why the roundRadius property is not present in groups. Now I see that it would also be nice if the images had it.
The problem you are facing I have already faced and here is the solution I found.
The code is on the stack that I attach.
look at the exportSnapshotPNG command
- Attachments
-
- CropAvatar.zip
- (50.64 KiB) Downloaded 114 times
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: Make a round photo icon for OSX and Mobile
This script works in your saveImage button.
Code: Select all
on mouseUp pMouseButton
export snapshot from rect(the rect of graphic "PhotoCircle") of this card to tFileVar as PNG
put tFileVar into image "FinalImage" of card "cardShow"
go card "cardshow"
end mouseup
Re: Make a round photo icon for OSX and Mobile
Great answers: thanks
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>