绘图应用程序如何保存在android手机内存绘图应用程序、内存、存在、手机

2023-09-09 21:53:53 作者:残留的回忆不如遗忘

我试图保存为PNG文件格式。它dose't工作时,我尝试发布到Android手机。我不明白的android手机的路径从文件夹到文件夹的工作。我如何使它工作...

我尝试相同的ActionScript 3和个人电脑上发布它和它的工作......

请帮助。抱歉语法错误。

 函数的出口():无效
        {



        VAR BMD:的BitmapData =新的BitmapData(480,800);

        bmd.draw(板);

        变种BA:的ByteArray = PNGEn coder.en code(BMD);

        var文件:的FileReference =新的FileReference();

        file.save(BA,MyDrawing.png);

    }
 

解决方案

这是我的样子将图像保存在Android上:

  var文件:文件= File.applicationStorageDirectory.resolvePath(MyDrawing.png);
VAR流:的FileStream =新的FileStream();
stream.open(文件,FileMode.WRITE);
stream.writeBytes(BA,0,ba.length);
stream.close();
 
手把手教你读懂源码,View的加载流程详细剖析

I try to save in png file format. It dose't work when i try to publish to android phone. i do not understand how android phone path from folder to folder work. how do i make it work...

I try the same Actionscript 3 and publish it on my pc and it work....

pls help. sorry bad grammar.

function export():void
        {



        var bmd:BitmapData = new BitmapData(480, 800);

        bmd.draw(board);

        var ba:ByteArray = PNGEncoder.encode(bmd);

        var file:FileReference = new FileReference();

        file.save(ba, "MyDrawing.png");

    }

解决方案

This is the way i save images on Android:

var file:File = File.applicationStorageDirectory.resolvePath("MyDrawing.png");
var stream:FileStream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeBytes(ba, 0, ba.length);
stream.close();