Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7910333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:49:53+00:00 2026-06-03T12:49:53+00:00

I have an application that I can load an image through a URLLoader and

  • 0

I have an application that I can load an image through a URLLoader and pop it into a movie clip and display that movie clip.

I need to then be able to write that image into an xml file so that I can re-load the image if needed.

I am currently loading the image, and then storing it as BitmapData via something along the lines of:

var decodedBitmapData:BitmapData = Bitmap(image).bitmapData;
backgroundImageBitmapData = decodedBitmapData;

And then I do something along the following lines to write it into an xml file. The data is stored in an object that is stored in an array called aRooms. (Which is the above “backgroundImageBitmapData”.)

var tempImage:Bitmap = new Bitmap(aRooms[i].backgroundImageData);
var bytes:ByteArray = tempImage.bitmapData.getPixels(tempImage.bitmapData.rect);
var roomBG:XML = new XML( <bg> { String(bytes) } </bg>);

That roomBG (XML) variable is then appended to the full XML file that I am exporting.

From there, I need to read that xmllist and convert it to, I think, bitmapdata so I can load it via a loader. But that’s where I am stuck.

It is possible that I am saving it wrong as well, so if that is the case, all help and corrections are welcome.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T12:49:56+00:00Added an answer on June 3, 2026 at 12:49 pm

    If I understand your question correctly. You would like to have a string representation
    of the byte array. You could achieve this by having it base64 encoded. You can download the libs here.

    Then you would have something like this:

    var rect:Rectangle = new Rectangle(0,0,myImage.width,myImage.height);
    var byteArray:ByteArray = myImage.bitmapData.getPixels(rect);
    
    //to encode to a string
    var encoded:String = Base64.encodeByteArray(byteArray);
    
    //to decode the string 
    var decoded:ByteArray = Base64.decodeToByteArray(encoded);
    decoded.position = 0;
    
    var newBitmapData:BitmapData = new BitmapData(rect.width,rect.height,true,0xFFFFFFFF);
    newBitmapData.setPixels(rect, decoded);
    
    var newImage:Bitmap = new Bitmap(newBitmapData, "auto", true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that can load plugins through reflection. It currently uses
I have an application written with pyside where a user can load an image,
I have developed an image uploading application that uses Flash to load an image,
I have some JPEG files that I can't seem to load into my C#
I have an application that can filter a datagridview based on date using a
I have an application that can be viewed with landscape and portrait mode. I'm
I have an application that can potentially have hundreds of memory mapped, i.e., mmap()
I have a web application that you can use to import information from another
I have application that is up more than 3 days. I can see in
I'm writing a drawing application that includes shapes that can have children. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.