Solved

How to export canvas as png at 300 dpi

Posted on 2008-11-02
2
3,337 Views
Last Modified: 2013-11-11
I'm creating a Card design application in Flex 3 with php on the server side. I'm running into issues with exporting canvas to png at 300 dpi. So far image is only coming out as 72 dpi. Any idea how to make image output 300dpi. Here's how I currently capture the canvas before sending to php to save image:
drawingBoard.clipContent = false;

	Application.application.clipContent = false;

	

         var base64string:String = ImageSnapshot.encodeImageAsBase64( ImageSnapshot.captureImage(drawingBoard,300, new PNGEncoder(),false) );

Open in new window

0
Comment
Question by:skywalker98
2 Comments
 
LVL 1

Expert Comment

by:trypt
ID: 22866596
i don't think u can capture the screen with more than 72 dpi unless ur screen's resolution is more than 72 dpi... but i think u can try this work around... multiply the size of the screen capture image by 417%, then u should get the dimension of the image at 300dpi when printed out...
0
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 22902339

<?xml version="1.0" encoding="utf-8"?>

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" creationComplete="init()">

<mx:Script>

	<![CDATA[

		private function init():void

		{

			drawArea.graphics.drawCircle(100,100,100);

			var b:BitmapData = new BitmapData(1000,1000,false,0xFFFFFF);

			var m:Matrix = new Matrix();

			m.scale(300.0/72.0);

			b.draw( drawArea, m);

			var bmp:Bitmap = new Bitmap( b, "auto", true); 

			// bmp will now contain a 300dpi version of drawArea

			// save data here

			b.dispose(); // clean up

		}

	]]>

</mx:Script>

	<mx:HBox id="drawArea" x="24" y="22" width="352" height="211">

	</mx:HBox>

</mx:Canvas>

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Software Restriction Policy 8 856
Flash player updates using SCCM 2012 and SCUP 2011 3 391
How to block online streaming via TMG2010 ? 2 123
Actionscript in Flash 3 47
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…
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 select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

895 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

15 Experts available now in Live!

Get 1:1 Help Now