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

  • Home
  • SEARCH
  • 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 6552469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:27:48+00:00 2026-05-25T12:27:48+00:00

I have a BitmapData object named myBitmapData. It was loaded of PNG of size

  • 0

I have a BitmapData object named myBitmapData. It was loaded of PNG of size 104×104. This PNG represents a red circle on the transparent background.
There is also a Sprite object named myBackground. I want render that red circle into myBackground.

myBackground.graphics.beginBitmapFill(myBitmapData);
myBackground.graphics.drawRect(0, 0, myBitmapData.width, myBitmapData.height);
myBackground.graphics.endFill();
addChild(myBackground);

Everything is fine. I see a red circle in the left top of myBackground.

But when I change the third line to

myBackground.graphics.drawRect(0, 52, myBitmapData.width, myBitmapData.height);

and expect my circle to be translated 52 pixels down, I actually obtain something strange (for me :)): there are two red half-circles (they form like hourglass).

So, the question is: how do I render myBitmapData into the random position of myBackground?

P.S.
In the case of

myBackground.graphics.drawRect(0, 104, myBitmapData.width, myBitmapData.height);

it is circle again 🙂

  • 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-25T12:27:49+00:00Added an answer on May 25, 2026 at 12:27 pm

    This is caused by beginBitmapFill‘s default repeat = true parameter. There’s an example in the docs. Disabling the repetition won’t work though, you’d just get a half circle then.

    There are several ways to fix this:

    • Use a Matrix with a translation (displacement) as argument in beginBitmapFill.
    • Draw the rectangle at 0,0 on another Sprite, and move that sprite to where you want it on the background.
    • Don’t draw directly to the background, but to another bitmap using copyPixels. Then fill the background with that bitmap.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
Let say I have a BitmapData with different pixels representing an object, and some
have written this little class, which generates a UUID every time an object of
I have a code like this: var bitmapData:BitmapData = new BitmapData(width, height); bitmapData.draw(this); var
I have a BitmapData object with an alpha channel. I'd like to know the
I'm trying to use PNGEncoder to encode a bitmapData object into a png ByteArray
I have a BitmapData object created dynamically that contains user-drawn shapes. I then attach
I have converted a PNG into a bitmap, then converted that into bitmapData. I
In my class I have created a Bitmap with a corresponding BitmapData object: Class
I have written this piece of code: bitmapData = calloc(1, bitmapByteCount ); context =

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.