php - how to create a '.png' image from a flash object -


how create '.png' image flash object.

currently using 'openflashchart' in application, works , shows me flash of bar or pie chart, want store '.png' image of chart in folder.

note : have removed 'ofc_upload_image.php' file library has vulneribilities. so, want convert flash '.png' image.

thanks in advance

taking screenshot in swf , encoding straightforward:

var screen:bitmapdata = new bitmapdata(stage.stagewidth, stage.stageheight); screen.draw(stage, null, null, null, new rectangle(0, 0, stage.stagewidth, stage.stageheight));  var encoder:pngencoder = new pngencoder(); var png:bytearray = encoder.encode(screen); 

you can replace rectangle params necessary capture portion (e.g. chart).

i'm going assume wanting upload image server, in case can use urlloader send byte array containing encoded png data:

var request:urlrequest = new urlrequest(your_url); request.contenttype = "application/octet-stream"; request.method = urlrequestmethod.post; request.data = png;  var loader:urlloader = new urlloader(); loader.load(request); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -