AS Flex 4 PNGEncoder color depth

Posted on 2011-05-05
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 );

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

	var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
	var uRLRequest:URLRequest = new URLRequest(imageExportURL);
	uRLRequest.method = URLRequestMethod.POST; = pngData;

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.

Question by:cfpdev
    LVL 29

    Accepted Solution


    Assisted Solution

    Thanks for response.

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

    Any other suggestions?
    LVL 29

    Expert Comment

    I think my links describe the logic how to generate and save 24 BitsPerPixel color depth image(s) using ActionScript

    Author Closing Comment

    not really an answer to my question but a workaround

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now