BitmapData.draw() + registration point problem solved!

Posted by Fourneau Brecht | Posted in Development | Posted on 31-10-2008

1

I’ve been having this nasty problem with BitmapData, I wanted to make a copy of a MovieClip to use it as a reflection of the original MovieClip. This is easy ofcourse using the BitmapData.draw() function. But this only works for MovieClips with the registration point in the top left corner, the draw() method only draws positive data. I found this to be a real pain in the ass because the registration point needed to be in the center for my animations to work good. And halleluja, I found a solution! Using a matrix object I changed the area the draw method should draw into the whole MovieClip. Here’s my code:

var bmd:BitmapData = new BitmapData(my_mc.width,my_mc.height,true,0xFFFFFF);

var m:Matrix = new Matrix();

m.translate(my_mc.width/2,my_mc.height/2);

bmd.draw(my_mc,m);

var bitmap:Bitmap = new Bitmap(bmd);

addChild(bitmap);

I hope I helped some of you with this, because I didn’t really read a good solution on the internet for this problem. If you have any questions, just e-mail me at: mail@brechtfourneau.be

Currently working very hard on my portfolio, I hope I can show it to you all quickly :) (if anyone ever really reads this)

See you.

Get Connected!

Posted by Fourneau Brecht | Posted in Uncategorized | Posted on 26-10-2008

1

Let me start off with telling you who I am, I’m a 20 year old Multimedia-student @ Hogeschool West-Vlaanderen (PIH) in Kortrijk.  I’m passionated with designing (in Adobe Photoshop or Illustrator) and coding (I like to work with Java and ActionScript).

Other hobbies of me are watching television series (Fringe, Heroes, Lost, Dexter, Family Guy,..) and listening to a wide variety of music, from groups like Pink Floyd and The Doors to nifty electronic music by, for example, Boys Noize. I enjoy going out with friends, being in contact with other people and sharing experiences.

The reason I created this blog is to share with you what I’m all about and so on, I want to evolve to become a better developer and designer and I think it would be cool to see this evolution on my blog. I just got back from what you may call a teambuilding weekend with all the guys and a few girls from the Multimedia-course. It was very inspiring to me and it made me get really excited and determined to grow and try to reach a higher level. I hope I can eventually get there.

So, welcome here and check back soon.