shardul_bartwal
asked on
High Dpi Images from flash player by using ImageSnapshot class
Hi all,
I am working in a flex application.I want to get the print quality images from the ImageSnapshot.captureImage ().This method increase the image size as I increase the dpi.But the problem is with the big dimension images.Let suppose my image size is 2880 * 2880. Then it can not give me the output with more then this size,no matter what dpi i mention.
I want to increase the dpi of my images upto 200. If any one have any idea please suggest me.
I am using the flash player 10.1.
with Regards,
Shardul
I am working in a flex application.I want to get the print quality images from the ImageSnapshot.captureImage
I want to increase the dpi of my images upto 200. If any one have any idea please suggest me.
I am using the flash player 10.1.
with Regards,
Shardul
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes you are right according to the documentation.
I have already tried for the same.
You can view my source code this is just for demo.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" width="100%" height="100%" scriptTimeLimit="90">
<mx:Script>
<![CDATA[
import mx.graphics.ImageSnapshot;
import mx.graphics.codec.JPEGEnco der;
private function saveImageToFileSystem():vo id
{
var jPEGEncoder:JPEGEncoder = new JPEGEncoder(85);
var imageSnapshot:ImageSnapsho t = ImageSnapshot.captureImage (imgCanvas ,72,jPEGEn coder,fals e);
var fileReference:FileReferenc e = new FileReference();
fileReference.save(imageSn apshot.dat a, "img123.jpg");
}
]]>
</mx:Script>
<mx:Canvas width="2880" height="2880" id="imgCanvas">
<mx:Image width="100%" height="100%" source="maxx.jpg" maintainAspectRatio="true" />
</mx:Canvas>
<mx:Button label="Take a Picture" click="saveImageToFileSyst em()" x="340" y="20" />
</mx:Application>
I this application if i change my dpi more then 72 then it gives me error inside the ImageSnapshot class,at :-
finally
{
if (source is IUIComponent)
finishPrintObject(IUICompo nent(sourc e), normalState);
}
If i tried to comment it then it simply gives me error related to the memory of the flash player,or sometimes script executed for long time.................
with Thnx,
Shardul
I have already tried for the same.
You can view my source code this is just for demo.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" width="100%" height="100%" scriptTimeLimit="90">
<mx:Script>
<![CDATA[
import mx.graphics.ImageSnapshot;
import mx.graphics.codec.JPEGEnco
private function saveImageToFileSystem():vo
{
var jPEGEncoder:JPEGEncoder = new JPEGEncoder(85);
var imageSnapshot:ImageSnapsho
var fileReference:FileReferenc
fileReference.save(imageSn
}
]]>
</mx:Script>
<mx:Canvas width="2880" height="2880" id="imgCanvas">
<mx:Image width="100%" height="100%" source="maxx.jpg" maintainAspectRatio="true"
</mx:Canvas>
<mx:Button label="Take a Picture" click="saveImageToFileSyst
</mx:Application>
I this application if i change my dpi more then 72 then it gives me error inside the ImageSnapshot class,at :-
finally
{
if (source is IUIComponent)
finishPrintObject(IUICompo
}
If i tried to comment it then it simply gives me error related to the memory of the flash player,or sometimes script executed for long time.................
with Thnx,
Shardul
Not that you would want to ask your users to do this, but have you checked you Flash plugin's memory settings? It definitely sounds like a Flashplayer issue.
ASKER
Yes you are right....... This is again a very big issue for me, till date I have not got any solution and link for
'Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.'.
Because by any means I am not able to execute the script for more then this time I have also tried it as a compiler argument as well as scriptTimeLimit property at application level.But no benefit.
Hence I am just hanging for the big bitmap Data.
with Thnx,
Shardul
'Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.'.
Because by any means I am not able to execute the script for more then this time I have also tried it as a compiler argument as well as scriptTimeLimit property at application level.But no benefit.
Hence I am just hanging for the big bitmap Data.
with Thnx,
Shardul
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Tom,
Yes I will try this asap from the server end and will let you know about this asap. Thnx for your kind coperation.
with Reagrds,
Shardul
Yes I will try this asap from the server end and will let you know about this asap. Thnx for your kind coperation.
with Reagrds,
Shardul
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
Open in new window