Link to home
Start Free TrialLog in
Avatar of cfpdev
cfpdev

asked on

AS Flex 4 PNGEncoder color depth

Hi there

I'm generating a PNG image from a Flex application. Everything works perfect.

I'm looking to adjust a color depth of produced image (still on the Flex side).

// Save as image //////////////////////////
private function saveAsImage():void
{
	var pngSource:BitmapData = new BitmapData (mychart.width, mychart.height );
	pngSource.draw(mychart);

	var pngEncoder:PNGEncoder = new mx.graphics.codec.PNGEncoder();
	var pngData:ByteArray = pngEncoder.encode(pngSource);

	var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
name=chart.png");
	var uRLRequest:URLRequest = new URLRequest(imageExportURL);
				
	uRLRequest.requestHeaders.push(header);
	uRLRequest.method = URLRequestMethod.POST;
	uRLRequest.data = pngData;
	navigateToURL(uRLRequest);
}	

Open in new window


The reason for this our module which process the image further can't cope with 16,7 Millions   (24 BitsPerPixel) color depth.

Thanks
Rad
ASKER CERTIFIED SOLUTION
Avatar of dgofman
dgofman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think my links describe the logic how to generate and save 24 BitsPerPixel color depth image(s) using ActionScript
Avatar of cfpdev
cfpdev

ASKER

not really an answer to my question but a workaround