Page 1 of 1

Passing Bitmapdata to report

Posted: Thu Mar 15, 2012 5:18 am
by Stranger
I create new image in report. How to transfer bitmap data from application code into report image variable?

Passing Bitmapdata to report

Posted: Fri Mar 16, 2012 10:05 am
by Vladimir
Hello,

Please try to use the following code:

Code: Select all

// Some BitmapData
var bitmapData: BitmapData;

var png: PNGEncoder = new PNGEncoder();
var bytes: ByteArray = png.encode(bitmapData);

// Get Image component by name from report
var img: StiImage = report.getComponentByName("Image1");
img.image = StiTypeConverter.byteArrayToBase64(bytes);
Thank you.

Passing Bitmapdata to report

Posted: Mon Mar 19, 2012 3:55 am
by Stranger
This code work fine with simple modification:

var img: StiImage = report.getComponentByName("Image1") as StiImage;

Passing Bitmapdata to report

Posted: Mon Mar 19, 2012 5:50 am
by Vladimir
Hello,

Yes, you're right.

Let us know if you need any additional help.

Thank you.