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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:21:54+00:00 2026-05-20T19:21:54+00:00

maintaining the center registration point of a circle shape, or any other display object

  • 0

maintaining the center registration point of a circle shape, or any other display object with center registration, while being converted to a bitmap object is proving to be difficult.

the following code converts a circle shape into a bitmap object and positions it in the center of the stage and subsequently removes its center registration poin.

the x and y origin of a new bitmapData object (top left) is the same as the x and y origin of the circle (center), but it’s not possible to translate the x and y position of the bitmapData.draw() – its parameters only accept width, height, transparency and fill color.

var myCircle:Shape = new Shape();
myCircle.graphics.beginFill(0xFF0000, 1.0);
myCircle.graphics.drawCircie(0, 0, 100);
myCircle.graphics.endFill();

var matrix:Matrix = new Matrix();
matrix.tx = myCircle.width / 2;
matrix.ty = myCircle.height / 2;

var myCircleBitmapData:BitmapData = new BitmapData(myCircle.width, myCircle.height, true, 0x00FFFFFF);
myCircleBitmapData.draw(myCircle, matrix);

var result:Bitmap = new Bitmap(myCircleBitmapData, PixelSnapping.AUTO, true);
result.x = stage.stageWidth / 2 - matrix.tx;
result.y = stage.stageHeight / 2 - matrix.ty;

addChild(result);

with the help of a matrix translation, the new bitmap object will appear centered in the stage, but applying a regular or 3D rotation, etc., will clearly demonstrate that the registration point is now the top left corner instead of the center.

how can i convert a center registered display object into a bitmap while maintaining its center registration?

  • 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-20T19:21:54+00:00Added an answer on May 20, 2026 at 7:21 pm

    it appears the most common approach is to simply add the bitmap as a child of a sprite container and rotate the sprite container rather than the bitmap itself.

    var myCircle:Shape = new Shape();
    myCircle.graphics.beginFill(0xFF0000, 1.0);
    myCircle.graphics.drawCircie(0, 0, 100);
    myCircle.graphics.endFill();
    
    var matrix:Matrix = new Matrix();
    matrix.tx = myCircle.width / 2;
    matrix.ty = myCircle.height / 2;
    
    var myCircleBitmapData:BitmapData = new BitmapData(myCircle.width, myCircle.height, true, 0x00FFFFFF);
    myCircleBitmapData.draw(myCircle, matrix);
    
    var myCircleBitmap:Bitmap = new Bitmap(myCircleBitmapData, PixelSnapping.AUTO, true);
    myCircleBitmap.x -= matrix.tx;
    myCircleBitmap.y -= matrix.ty;
    
    var circleContainer:Sprite = new Sprite();
    circleContainer.addChild(myCircleBitmap);
    

    alternatively, for those using Flash Professional IDE, there is the option to employ fl.motion.MatrixTransformer.rotateAroundInternalPoint instead of using a container sprite.

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

Sidebar

Related Questions

Possible Duplicate: Vertical centering variable height image while maintaining max-width/height So here is a
While maintaining an old product, I came across an error that results in the
While maintaining some code, I discovered that we have an infinite hang-up in a
I am working on maintaining some page developed by someone other. I have noticed,
I want to create a javascript/jquery function which will resize an img (while maintaining
m maintaining a project, that has to be compatible through PHP 4.X to 5.2.
I am maintaining a web application that uses java.protocol.handler. I initialize it with a
I am maintaining some legacy Visual Basic ASP code and I keep seeing <%
When I'm maintaining and distributing a Python package, should I keep the MANIFEST file
I'm currently maintaining an "old" system written in C# .NET, removing some obsolete features

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.