Murtaza
Murtaza

Reputation: 9

Advanced Image cropping and image resizing in Flex

I have created a image cropping tool in flex using core copyPixel method.

croppedBitmapData.copyPixels(croppedBitmapData, clipCan, new Point(0, 0));

I have to crope area of dementions 20*20 and show this cropped area in an image of demention 250*350. Every thing going well. My problem is image distortion.

Even i am using this method for smoothing image contents on complete.

private function smoothImage(event:Event):void
{
    var bitmap: Bitmap = ((event.target as Image).content as Bitmap);
    if (bitmap != null) 
    {
     bitmap.smoothing = true;
    }
}

I want to get the result of this site. http://www.yourplayingcards.com/builder/

Please help me to get ride of image distortion.

      Can we show bitmapdata of 20*20 into image of 250*350 without distotion?

Upvotes: 1

Views: 1710

Answers (2)

Imran
Imran

Reputation: 3024

I am not sure about that but it is done in VectorMagic may be they are using server side too any ways, you may also interested in Actionscript SVG renderer

Hopes that helps

Upvotes: 0

J_A_X
J_A_X

Reputation: 12847

What you call 'distortion' is probably what I think you mean by pixelation. The reason why that website can zoom in without pixelation is because it's using vector shapes, not bitmaps, to show the graphics. Vector shapes can be scale infinitely without loss of quality because it doesn't store pixel information, but spline information.

In essence, if you want to imitate the zooming of the the website you have shown, you will have to create your own vector shape. You can use Flex 4's built in FXG format or use something like Degrafa if you're still in Flex 3. You can also leverage Flash Catalyst to import vector graphics made in Illustration into Flex.

Upvotes: 1

Related Questions