开发者

Advanced Image cropping and image resizing in Flex

开发者 https://www.devze.com 2023-02-28 23:24 出处:网络
I have created a image cropping tool in flex using core copyPixel method. croppedBitmapData.copyPixels(croppedBitmapData, clipCan, new Point(0, 0));

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;
 开发者_如何学Go   }
}

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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号