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!
Exactly what we needed! Thanks
Comment by Simoens — June 6, 2008 @ 7:02 am
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
Comment by Vladimir — June 21, 2008 @ 5:07 pm
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.
Comment by flas3 — June 23, 2008 @ 7:21 am
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 !!!
Comment by Vladimir — June 23, 2008 @ 5:13 pm
Dear sir!
We have seen your code.
Your example works wonderfully!
Thanks and Best regards !!!
Vladimir, Almaty, Kazakhstan
Comment by Vladimir — June 23, 2008 @ 5:55 pm
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!
Comment by Tarwin Stroh-Spijer — August 25, 2008 @ 6:02 am
Sorry guys. I was not available and event not in touch for such a long time.
Comment by flas3 — October 11, 2008 @ 11:35 am
good method
Comment by andol — January 6, 2009 @ 5:12 pm