Code: Select all
on mouseUp
answer question "Take a Picture or Choose a Photo" with "Cancel" or "Take" or "Choose"
if it = "Choose" then
answer file "Choose an image file to import"
if the result = "cancel" then
exit mouseUp
else
put it into PATEKA
set the height of image "The_Image" to 250
set the width of image "The_Image" to 250
if PATEKA is not empty then
set the filename of img "The_Image" to PATEKA
set the lockscreen to true
set the name of the last control to "The_Image"
put the width of img "The_Image" into WIDD
put the height of img "The_Image" into HITE
if WIDD < HITE then
put 250 into nHITE
put WIDD/HITE into sFACTOR
put 250*sFACTOR into nWIDD
set the width of img "The_Image" to nWIDD
set the height of img "The_Image" to nHITE
else
put 250 into nWIDD
put HITE/WIDD into sFACTOR
put 250*sFACTOR into nHITE
set the width of img "The_Image" to nWIDD
set the height of img "The_Image" to nHITE
end if
end if
end if
end if
if it = "Take" then
mobilePickPhoto "camera", 250, 250
if the result = "cancel"
then
exit mouseUp
else
put it into PATEKA
set the height of image "The_Image" to 250
set the width of image "The_Image" to 250
if PATEKA is not empty then
set the filename of img "The_Image" to PATEKA
set the lockscreen to true
set the name of the last control to "The_Image"
put the width of img "The_Image" into WIDD
put the height of img "The_Image" into HITE
if WIDD < HITE then
put 250 into nHITE
put WIDD/HITE into sFACTOR
put 250*sFACTOR into nWIDD
set the width of img "The_Image" to nWIDD
set the height of img "The_Image" to nHITE
else
put 250 into nWIDD
put HITE/WIDD into sFACTOR
put 250*sFACTOR into nHITE
set the width of img "The_Image" to nWIDD
set the height of img "The_Image" to nHITE
end if
end if
end if
end if
if it = "Cancel" then
exit mouseUp
end if
end mouseUp