Hello!
I noticed that, when i change isFullResolution param in method display.save() NOTHING happens…
As far as i know, when flag is set on true, saved image should be exactly the same as displayed in Corona. But it doesn’t.
Looks like Corona ignores that flag and always saves image in device resolution.
How to save image with exactly the same dimensions as displayed in Corona? I need this to generate dynamically masks.
Here is my sample main.lua code, where i make 4 rects, saving them with different isFullResolution param then i create image of saved rect via display.newImage(), again with diffrent values on isFullResolution param.
I attach graphics output of that code.
timer.performWithDelay( 1000, function() local green = display.newRect( 50, 50, 25, 25) green:setFillColor( 0,1,0 ) display.save( green, {filename = "green.png", baseDir = system.TemporaryDirectory, isFullResolution = false} ) display.newImage( "green.png", system.TemporaryDirectory, 100, 50, false ) local red = display.newRect( 50, 100, 25, 25) red:setFillColor( 1,0,0 ) display.save( red, {filename = "red.png", baseDir = system.TemporaryDirectory, isFullResolution = false} ) display.newImage( "red.png", system.TemporaryDirectory, 100, 100, true ) local blue = display.newRect( 50, 150, 25, 25) blue:setFillColor( 0,0,1 ) display.save( blue, {filename = "blue.png", baseDir = system.TemporaryDirectory, isFullResolution = true} ) display.newImage( "blue.png", system.TemporaryDirectory, 100, 150, false ) local yellow = display.newRect( 50, 200, 25, 25) yellow:setFillColor( 1,1,0 ) display.save( yellow, {filename = "yellow.png", baseDir = system.TemporaryDirectory, isFullResolution = true} ) display.newImage( "yellow.png", system.TemporaryDirectory, 100, 200, true ) end )
Simulator is set on android device(hdpi), the same result i got on xperia m2.
and here is mine build.settings and config.lua
settings = { orientation = { default = "landscapeRight", supported = { "landscapeLeft", "landscapeRight" }, }, }
application = { content = { scale = "adaptive", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.6, } }, }
Thanks for your advice.