[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

AS Flex 4 PNGEncoder color depth

Posted on 2011-05-05
4
Medium Priority
?
684 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:cfpdev
  • 2
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 800 total points
ID: 35700791
0
 

Assisted Solution

by:cfpdev
cfpdev earned 0 total points
ID: 35719376
Thanks for response.

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

Any other suggestions?
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35724123
I think my links describe the logic how to generate and save 24 BitsPerPixel color depth image(s) using ActionScript
0
 

Author Closing Comment

by:cfpdev
ID: 35872621
not really an answer to my question but a workaround
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question