[Resolved] Cannot read saved imaged from system.DocumentsDirectory

Hi
i save an image using display.save( ) on to system.DocumentsDirectory and am trying to display it on the screen

i used

local path=system.pathForFile( name, system.DocumentsDirectory )

where name is “image.jpg”
and when i give this

display.newImage(path ,300,300)

gives no error but say that cannot find the image

is this the right way to do it or am i wrong some where. [import]uid: 115284 topic_id: 25826 reply_id: 325826[/import]

Try running this code;
[lua]g = display.newGroup()

local image_array = {}

for i = 1, 3 do
image_array[i] = display.newRect( i*50, 20, 20, 20 )
g:insert(image_array[i])
end
local baseDir = system.DocumentsDirectory
display.save( g, “entireGroup.jpg”, baseDir )

local test = display.newImage(“entireGroup.jpg”, baseDir)
test.x, test.y = 100, 100[/lua]

Or using; display.newImage(“name”, directory)

That should do it :slight_smile: [import]uid: 52491 topic_id: 25826 reply_id: 104435[/import]

Hi thanks this code works. [import]uid: 115284 topic_id: 25826 reply_id: 104578[/import]

No worries, always happy to help :slight_smile: [import]uid: 52491 topic_id: 25826 reply_id: 104603[/import]