I am trying to serialize a Bitmap to store in an XML file. My plan is to turn the BitmapData into a byteArray, but I haven’t been able to fine an example of this.
Other suggestions are also welcome.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The process should be: BitmapData > ByteArray > Base64 > XML
Use the BitmapData getPixels() method to get a ByteArray of the pixels.
Then you can use something like Hurlant’s Base64 encoder to convert it to base 64.
Then going the other way, “unbase64” it, then use BitmapData’s setPixels to load it.