Hello, Ive been trying to select a saved image from the gallery on the android device and have it copy the image and paste it in a folder thats in the applications directory.
I also tried to make it so it opens the image from the gallery and screenshots it and saves it to another folder but I cant get either to work. I fairly new to this and would love any help
Thanks in advance
local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) local capture = display.captureScreen(true) display.save(capture, {filename="Test.png", baseDir="photos", isFullResolution=true, backgroundColor={0,0,0,0} } ) end -- Create the widget local button1 = widget.newButton( { left = 100, top = 200, id = "button1", label = "ScreenShot", onPress = handleButtonEvent } ) local function onComplete( event ) local photo = event.target local s = display.contentHeight / photo.height photo:scale( s,s ) photo.x = centerX photo.y = centerY print( "photo w,h = " .. photo.width .. "," .. photo.height ) end if media.hasSource( media.PhotoLibrary ) then media.selectPhoto( { mediaSource=media.PhotoLibrary, listener=onComplete } ) else native.showAlert( "Corona", "This device does not have a photo library.", { "OK" } ) end