java - Save image to iOS Gallery from libGDX -


i need export image libgdx game, , make appear in default photos app on ipad.

currently, this:

pixmap image = getscreenshot();  filehandle file; string filename = "diplom_" + game.player.getid() + ".png";  if(gdx.files.isexternalstorageavailable())     file = gdx.files.external(filename); else     file = gdx.files.local(filename);  pixmapio.writepng(file, image); pixmap.dispose(); 

but screenshot doesn't appear anywhere. how can make appear in photos app?

at first try adding logger see add put file.

if put in local:

local files stored relative application's root or working directory on desktops , relative internal (private) storage of application on android. note local , internal same on desktop.

if external

external files paths relative sd card root on android , home directory of current user on desktop systems.

refare filehandling libgdx wiki

so guess save in local thats why wont find in ios. else need create right path pictures folder. else save @ same folder apps installed. think youll need use absolut verion of filehandle. else can save @ total different path.

in case, “myfile.txt” needs in users’ home directory (/home//myfile.txt on linux or \users\\myfile.txt on windows , macos) on desktop, , in root of sd card on android.

filehandle handle = gdx.files.absolute("/some_dir/subdir/myfile.txt"); 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -