Passing Bitmapdata to report

Stimulsoft Reports.Flex discussion
Locked
Stranger
Posts: 2
Joined: Thu Mar 15, 2012 5:14 am

Passing Bitmapdata to report

Post by Stranger »

I create new image in report. How to transfer bitmap data from application code into report image variable?
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Passing Bitmapdata to report

Post 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.
Stranger
Posts: 2
Joined: Thu Mar 15, 2012 5:14 am

Passing Bitmapdata to report

Post by Stranger »

This code work fine with simple modification:

var img: StiImage = report.getComponentByName("Image1") as StiImage;
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Passing Bitmapdata to report

Post by Vladimir »

Hello,

Yes, you're right.

Let us know if you need any additional help.

Thank you.
Locked