10-05-2011 11:43 AM
I am creating an application in playbook using adobe air,
in which i need to resize the image size
like i am having 1024 x 768 resolution image size in device having suppose 100kB size
now i want to resize it to some resolution like 200x 150, which should reflact to image itself, like on seeing this image properties in device, its size should be less.
Is it possible to do by code
Please help me..
Thanks in advance
10-05-2011 11:47 AM
10-05-2011 11:58 AM
Actually i want to upload image, so i need to resize the memory size of image by which i can send it in less data uses of network, because currently i am having 2452 x 1476 resolution but i need to display less resolution of it, which i am able to set it by using image class and its stretch property, but in case of uploading memory size is still same, so i want to reduce the image size, by which it can upload fast. Like using adobe photoshop we change the resolution of image and its reduce the data size too, exactly i also want to do this by code..
Please help me out from this problem
10-05-2011 12:02 PM - edited 10-05-2011 12:03 PM
Look at the JPEG encoder class where you can specify "quality" (0-100) that reduces the image memory/file size for upload. For example:
var jpg_encoder : JPEGEncoder = new JPEGEncoder( 100 );
var img : ImageSnapshot = ImageSnapshot.captureImage( original_img, 0, jpg_encoder );
10-05-2011 12:28 PM
Hello i have read about it.
here JPEGEncoder is an encoder which is used to encode, i am familiar with this class, in which we have a encode method which is used to provide byte array , but it takes min 1-2 sec to respond in device.
Here imagesnapshot method captureImage() method returns ImageSnapshot object,
Please provide me code snippet by which i can understand it easily , i will very thankful for you, as i need to implement it urgently.
Waiting for your response.
10-05-2011 12:54 PM
Guys sorry to inturrupt but how can i post a thread ? i have a problem with my bb when i'm upgrading my bbm .. Its giving me "Your device does not have enough storage space to complete the download. To continue downloading, delete the language that you do not use (i only have english) or delete an item from my world. Refer to the Help for more
10-05-2011 01:03 PM
Well pretty strange..
you will get this issue when your smartphone memory is full and there is no space to install this application.
dont feel if you SD card you can install it. you need to have enough internal memory space to install application.
that i feel so
10-05-2011 05:20 PM
memory size is still same, so i want to reduce the image size, by which it can upload fast. Like using adobe photoshop we change the resolution of image and its reduce the data size too, exactly i also want to do this by code..
You need to draw() it to a new bitmapData object, using a transformation matrix.
ie, an image with half the size:
var smallBitmap:BitmapData = new BitmapData(largeBitmap.width/2, largeBitmap.height/2, true, 0x0);
var m:Matrix = new Matrix();
Something like that
Btw, googling "as3 resize bitmapData" will not take you too long to find a solution... one of the nice things about working in flash.