Hello all,
I am building a graphic editor with Corona and everything is going smoothly for the most part. However, there is a case when I need to create a mask dynamically and I need to ensure that both width/height are divided by 4 to be compliant to mask usage (no problem here either)
I can create very complex mask with the snapshot API and specify a width/height that is divided by 4.
The problem is when I save the file (display.save), it is not saved with the actual width/height that I’ve specified but instead the file dimensions is adjusted based on the content scaling of the app. I understand that. Unfortunately, this is sometime screwing the actual size of the mask file that is no longer compliant to the divided by 4 rules as the number can even be odd on some devices.
Does any one, would know a magic recipes so, my saved file is still with a width/height divided by 4 ?
For sure, the best way would be for Corona to offer the ability to specify when saving to save as absolute, but I do not think it is possible.
My scaling mode in config.lua is “adaptive”
local maskGroup = display.newSnapshot( 128, 256) -- doing here a few operations to be create the mask display.save( maskGroup , { filename = maskFileName, jpegQuality = 1, captureOffscreenArea=true, backgroundColor={0,0,0,0} } )
Any help would be greatly appreciated.
