Flex 中的高级图像裁剪和图像大小调整
我使用核心 copyPixel 方法在 Flex 中创建了一个图像裁剪工具。
CroppedBitmapData.copyPixels(croppedBitmapData, ClipCan, new Point(0, 0));
我必须裁剪 20*20 的尺寸区域,并在 250*350 的尺寸图像中显示此裁剪区域。 一切都很顺利。 我的问题是图像失真。
即使我正在使用这种方法来完整平滑图像内容。
private function smoothImage(event:Event):void
{
var bitmap: Bitmap = ((event.target as Image).content as Bitmap);
if (bitmap != null)
{
bitmap.smoothing = true;
}
}
我想得到这个网站的结果。 http://www.yourplayingcards.com/builder/
请帮助我解决图像失真问题。
Can we show bitmapdata of 20*20 into image of 250*350 without distotion?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你所说的“失真”可能就是像素化的意思。该网站之所以可以在没有像素化的情况下放大,是因为它使用矢量形状而不是位图来显示图形。矢量形状可以无限缩放而不会损失质量,因为它不存储像素信息,而是存储样条信息。
本质上,如果您想模仿您所显示的网站的缩放,您将必须创建自己的矢量形状。您可以使用 Flex 4 内置 FXG 格式 或使用类似Degrafa(如果您仍在 Flex 3 中)。您还可以利用 Flash Catalyst 用于将 Illustration 中制作的矢量图形导入 Flex。
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.
我不确定这一点,但它是在 VectorMagic 中完成的,可能他们也以任何方式使用服务器端,您可能还对 Actionscript SVG 渲染器
希望有所帮助
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