display.save reload issues

Hi,

I am saving an object I create, actually its drawn polygon using newPolygon as a png.

saves fine.

When I load it back into the device it is huge !

So how can I load the image back into the device and have it loaded as the same size it was drawn?

At the moment I am using imageRect to scale the size but its as it says scales it to the size I specify and not the size drawn.

I know it is to do with the device resolution but lots of drawing apps will reload the image at the drawn size.

Maybe its because Iam saving an object? not the screen.

any help really appreciated.

Can you post your code?

I think I suggested this in an old direct e-mail, but grab the code for the progress ring here:

http://www.jasonschroeder.com/2014/12/21/progress-ring-module-for-corona-sdk/

Then, examine how Jason saved the image he generated and later used it for another purpose. (I’m aware you want to display the image and use it for something else.)

The key elements of his technique were:

  1. Do not save a full resolution.

  2. Small delay between capture and save.

  3. Small delay between saving and using image.  (He used it as a mask, but the order of events is similar for displaying.)

    local maskImage = display.capture(maskGroup, { saveToPhotoLibrary=false, isFullResolution=false } ) display.getCurrentStage():insert(1, maskImage) timer.performWithDelay(1, function() display.save( maskImage, { filename=objectName…".jpg", baseDir=system.TemporaryDirectory, isFullResolution=true} ) local mask = graphics.newMask( objectName…".jpg", system.TemporaryDirectory ) timer.performWithDelay(1, function() bg:setMask(mask)

Can you post your code?

I think I suggested this in an old direct e-mail, but grab the code for the progress ring here:

http://www.jasonschroeder.com/2014/12/21/progress-ring-module-for-corona-sdk/

Then, examine how Jason saved the image he generated and later used it for another purpose. (I’m aware you want to display the image and use it for something else.)

The key elements of his technique were:

  1. Do not save a full resolution.

  2. Small delay between capture and save.

  3. Small delay between saving and using image.  (He used it as a mask, but the order of events is similar for displaying.)

    local maskImage = display.capture(maskGroup, { saveToPhotoLibrary=false, isFullResolution=false } ) display.getCurrentStage():insert(1, maskImage) timer.performWithDelay(1, function() display.save( maskImage, { filename=objectName…".jpg", baseDir=system.TemporaryDirectory, isFullResolution=true} ) local mask = graphics.newMask( objectName…".jpg", system.TemporaryDirectory ) timer.performWithDelay(1, function() bg:setMask(mask)