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
cfpdevAsked:
Who is Participating?
 
cfpdevConnect With a Mentor Author Commented:
Thanks for response.

Links are useful but they don't really answer my question.

Any other suggestions?
0
 
dgofmanCommented:
I think my links describe the logic how to generate and save 24 BitsPerPixel color depth image(s) using ActionScript
0
 
cfpdevAuthor Commented:
not really an answer to my question but a workaround
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.