This is driving me crazy! I need to take a portion of the screen and crop it and save as an image. The only way I’ve found to actually crop an image and save it again is to move it partially off the screen and then save (the off-screen portion is cropped). This works perfectly in the simulator, but not on the iPAD (it does crop, but it’s skewed so it’s not the portion of the screen I want). Any ideas?
-- Variables
w = display.contentWidth
h = display.contentHeight
-- Get screen capture
local screenCap = display.captureScreen( false )
-- Move down right to crop bottom right corner, and save image.
screenCap:setReferencePoint(display.TopLeftReferencePoint);
screenCap.x = w/2-240/2; screenCap.y = h/2-280/2
display.save(screenCap, "tempFace.jpg", system.DocumentsDirectory)
screenCap:removeSelf()
-- Then load back in and move to top left corner and save to crop
screenCap2 = display.newImage("tempFace.jpg",system.DocumentsDirectory,0,0,true)
screenCap2:setReferencePoint(display.BottomRightReferencePoint);
screenCap2.x = 240; screenCap2.y = 280;
-- Save Picture (240 x 280)
display.save(screenCap2, "newFace" .. faceNum .. ".jpg", system.DocumentsDirectory)
Please help. I’ve tried the various crop libraries, and they work inside the app, but not for saving the image. [import]uid: 90248 topic_id: 23948 reply_id: 323948[/import]