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 7643243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:23:59+00:00 2026-05-31T09:23:59+00:00

For the past few hours I have been trying to clone an image in

  • 0

For the past few hours I have been trying to clone an image in Flex (using the Spark Components, but also trying to convert between Bitmap and BitmapImage).

What I am trying exactly is to create a simple painting application which keeps track of each Brush-Stroke. As soon as the Image on the Canvas has changed, it is to be cloned and then the clone is to be put into the History-Panel on the bottom of the application.

Things I have tried include:

  • Using ObjectUtils.clone(Object)
  • Creating BitmapData from Image.content, then making it a Bitmap and simply display it (Image doesn’t have a content field, it says)
  • Performing a byte-copy
    and others I could find on the internet, of course.

So basically, how does one clone an Image (Spark Image) in Flex 4.6?

Thank you very much!

— Danny Nophut

  • 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-05-31T09:24:01+00:00Added an answer on May 31, 2026 at 9:24 am

    Instead of cloning you can get the image of the drawing and set the bitmap of the image as source to the history image, do some thing like this

    private function getBitmapData( target:DisplayObject ) : BitmapData
    {
    
       //target.width and target.height can also be replaced with a fixed number.
       var bd : BitmapData = new BitmapData( target.width, target.height );
       bd.draw( target );
       return bd;
    }
    

    In some case if the width and height of the target is not working you can use the getbounds method to get the bounds of the object and from the bounds take the width and height.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to find a solution for past few hours but unable
I have been struggling with this for the past few hours. All I'm trying
So, I have been trying for the past few hours to get an result
Been trying for the past few hours but can't seem to make it work.
For the past few days I have been trying to play any sound over
For the past few years I have been using Gary Keith's browscap file to
I've been trying to get this horizontal navigation sorted for the past few hours
I've been tearing my hair out the past few hours trying to solve this
Alright, I've trying to set up a TeamCity server the past few hours, but
For the past few hours I've been trying to figure out a way to

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.