Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

encode high res bitmaps from flash

Status
Not open for further replies.

theotrain

Programmer
Mar 5, 2003
150
MX
im trying to make a high res PDF from a flash movie using AS3. the PDF part seems pretty easy (alivePDF), but the high res part not so much.

where to begin? ok, i saw page where the guy described doing this in flex, to capture a high res image of a DIsplayObject.
Code:
var image:ImageSnapshot = ImageSnapshot.captureImage(DisplayObject, 300, new JPEGEncoder());

that uses ImageSnapshot which is in the mx.graphics package available in adobe flex. ive never used flex. is there any way i can use that jazz within flash? no luck so far.

so i tried making my image using just BitmapData instead.
Code:
import com.adobe.images.JPGEncoder;

var jpgSource:BitmapData = new BitmapData (myClip_mc.width, myClip_mc.height);
jpgSource.draw(myClip_mc);
var jpgEncoder:JPGEncoder = new JPGEncoder(100);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
this works, and i can make the bitmap "larger" by making the width and height greater:
Code:
var jpgSource:BitmapData = new BitmapData (myClip_mc.width*4, myClip_mc.height*4);
but the resulting image looks like a screen capture of the small version blown up. the text doesnt scale up pretty with the extra detail i want, it just takes the stuff on the screen and scales it up to look all jagged.

SO please anyone:
- possible to use mx.graphics.ImageSnapshot in flash??

if not
-how can i get a high res bitmap encoded properly from flash's vector output?

i would expect the vector stuff to look nice at high res, and it would be nice if high res bitmaps within flash could be sent out at their real resolution, so im not effectively doing a 72 dpi screen grab and making a giant bitmap out of that.

>thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top