Save photo/texture to folder in android device(gallery,documents..any folder)

Hi all,in my game i am able to take screenshots of the scene,my challenge is saving that screenshot to the android device.I have no idea on how to do this and after researching for a while still can’t find a working solution.any help with this will be much appreciated.
here is my current code.

    import System.IO;
    var explosion:GameObject[];
    var dec:GUITexture;
    var levelToLoad:String;
    // increment our filename
    private var count:int = 0;
     
    /**
    * Test key
    */
    function Update()
    {
     
    }
     
     
     
    //Take the screen buffer and spit out a JPG
     
    function ScreenshotEncode()
    {
    // wait for graphics to render
    yield WaitForEndOfFrame();
     
    // create a texture to pass to encoding
    var texture:Texture2D = new Texture2D (Screen.width, Screen.height, TextureFormat.RGB24, false);
     
    // put buffer into texture
    texture.ReadPixels(Rect(0.0, 0.0, Screen.width, Screen.height), 0.0, 0.0);
    texture.Apply();
     
    // split the process up--ReadPixels() and the GetPixels() call inside of the encoder are both pretty heavy
    yield;
     
    // create our encoder for this texture
    var encoder:JPGEncoder = new JPGEncoder(texture, 75.0);
     
    // encoder is threaded; wait for it to finish
    while(!encoder.isDone)
    yield;
     
    // save our test image (could also upload to WWW)
    File.WriteAllBytes(Application.persistentDataPath + "/../MyTree-" + count + ".jpg", encoder.GetBytes());
    yield WaitForSeconds(1);
    //play sound here
    //System.Diagnostics.Process.Start("mspaint.exe","MyTree-" + count + ".jpg");
    count++;
    guiTexture.enabled=true;
    dec.guiTexture.enabled=true;;
    Application.LoadLevel(levelToLoad);
    }
    function OnMouseDown(){
    Destroy(GameObject.FindWithTag("chickens"));
    Destroy(GameObject.FindWithTag("pal"));
    guiTexture.enabled=false;
    dec.guiTexture.enabled=false;
    Instantiate(explosion[Random.Range(0,explosion.Length)]);;
    yield WaitForSeconds(2);
    ScreenshotEncode();
    }

you can use

and use this
public static bool saveImageToGallery( string pathToPhoto, string title )
this class can screenshot scene and save to gallery
may be this helped :slight_smile:

Hi Friends,

Capture and Save plugin is available to save images in gallery for more detail visit this blog.