This content has been marked as final. Show 8 replies
If you can get the bitmapData that you want then perhaps you can use this (to ensure the quality) in as3:
Using a similar approach to the JPEG encoder saving jpegs here:
alternatively you could write it yourself using the compression that comes with AS3.
First you need to place your BitmapData into a ByteArray using BitmapData.getPixels.
Then you need to compress this data - you do this with ByteArray.compress() - this uses zlib compression.
The data is now ready to send.
Add your ByteArray variable to a URLRequest and send using flash.net.sendToURL or URLLoader.load(if you expect a response from the server)
@craig - I'm pretty sure the pngencoder already uses zlib compression plus you get the advantage of a recognised image format. (I haven't used it myself, just read the article).
Thank you, GWD and Craig. That is fabulous! I should be able to work something out from there. I thought what I'd do is have the image loaded off stage as well as in the scollpane on the stage. I'd merge that full image with a line that's drawn at the same time as the line that's drawn on the scollpane and export from there. The only problem I have with that is that the line must be in the bottom right corner of the image and the images imported will be many different shapes and sizes. I have no way of predicting where the bottom right corner will be as the image will register at the top left corner x 0 and y 0 point. If it were going in the top left corner all would be well. Any thoughts on that one?
Sorry I don't have experience trying something like that yet, particularly in as3 - I'm just starting to use it more. I'll leave the advice to others who do.
No worries, you've been a great help. Those links are very useful. I wish I weren't having to go straight to AS 3.0. The early adopter road is hard and full of scary places.
You're welcome. You carry a big stick for as3 when it get's out of line so you should be fine.