Sunday, 5 of September of 2010

Bitmapdata larger than 2880 pixel

The width and height parameters specify the size of the bitmap; the maximum value of both is 2880 pixels. Then how to create bitmapdata larger than the maximum specified size?

There are some tricks to snap a bitmap greater than 2880 pixels. One of the trick is this…

1. Load an empty white or black image of desired pixel size [say it would be around 3000x3000 pixels]

2. Clone its bitmapdata.

var bmpDtaClone:BitmapData = bmp.bitmapData.clone();

3. Now you free to draw anything on this bitmap data and flash would have no objection on it.

bmp.floodFill(0, 0, 0xFFFFFFFF);
bmpDtaClone.draw(this, this.transform.matrix, null, null, null, true);

Caution: Dont forget to dispose the bitmapdata as bitmapdata does not dispose itself. It could choke the memory tunnels.

Try this!

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.


Leave a Comment


Comments RSS TrackBack 7 comments

Simoens

in June 6th, 2008 @ 07:02

Exactly what we needed! Thanks

MyAvatars 0.2

Vladimir

in June 21st, 2008 @ 17:07

Dear sir!
It is very interesting!
I cannot make the example.
You can set to me an example of your code fla?
Thanks and Best regards !!!
Vladimir,
Kazakhstan, Almaty

MyAvatars 0.2

flas3

in June 23rd, 2008 @ 07:21

Hi Vladimir,
I have posted an example. I think this could help you. If you send me ur email id, I will send you the zipped source code.

Thanks.

MyAvatars 0.2

Vladimir

in June 23rd, 2008 @ 17:13

Dear sir!
My email:
new-techniq@narod.ru
We have the big problems at work with maps.
http://www.afcomponents.com/components/g_map_as3/
http://new-tech.intway.info/p1.htm
Your magnificent work very much will help all people!!!
We wait yours zipped source code!
Thanks and Best regards !!!

MyAvatars 0.2

Vladimir

in June 23rd, 2008 @ 17:55

Dear sir!
We have seen your code.
Your example works wonderfully!
Thanks and Best regards !!!
Vladimir, Almaty, Kazakhstan

MyAvatars 0.2

Tarwin Stroh-Spijer

in August 25th, 2008 @ 06:02

Thanks. This was a perfect solution for me as well.

For those people who are a little confused try this:

1. Go into Photoshop and make a new image, say 5000×5000 in size. Clear it so it’s totally transparent.
2. Save the image as a PNG. You cannot use the “Save for web…” option as it can’t handle images this large.
3. In Flash go to File -> Import to library. Choose the file you’ve just made in Photoshop.
4. Find the file you just imported in your library. Right click it and go to “Linkage…”
5. Click on the “Export for Actionscript” and then give it a name ie “E_LargeBitmap”
6. In your AS3 code you can put in a line of code like the following:

var largeBitmap:BitmapData = new E_LargeBitmap(5000, 5000);

You’ll now have a blank bitmap data (at least completely transparent one) that is super large (25 Megapixel image anyone?).

Have fun!

MyAvatars 0.2

flas3

in October 11th, 2008 @ 11:35

Sorry guys. I was not available and event not in touch for such a long time.

MyAvatars 0.2