旋转图像时候强迫光滑
2008-02-16 10:08
246 查看
导读:
在FLASH里进行伸缩和旋转是很容易的,只要使用_rotation,_xscale,成员。除非你发布一个FB8或者更新的SWF媒体内容,你伸缩或者旋转的每一张图片都会被锯齿化,非常讨厌。为了消除这一点你必须将媒体内容发布为FLASH7获得使用复杂的loadBitmapSmoothed 函数。
当FLASH8.5播放器发布时,他引入一个forceSmoothing 属性,该属性在AS2中也存在,现在我们所做的就是当装载图片的时侯将此属性设置为TRUE,当然不要忘记在FLASH播放器8.5以前的版本中该做法是没有任何效果。
这样做得到的效果很好,下面有一个例子展示这种做法。
Rotating and scaling pictures in flash is easy. Just use _rotation, _xscale and _yscale. Except when you publish an swf for Flash Player 8 or newer. Every image you rotate or scale will become jagged. Very anoying. To remedy this you can either publish for Flash 7 or use a complicated loadBitmapSmoothed function that uses BitmapData.
When Flash Player 8.5 came out it introduced the forceSmoothing property. This property is also available in as2. Now all we need to do is set it to true when we load images. Don’t forget that this will have no effect in Flash players older than version 8.5!
It works quite well. In the example below you can clearly see the left picture is more jagged than the right one.
var so = new SWFObject("http://www.crydust.be/blog/wp-content/uploads/forcesmoothing.swf", "forcesmoothing_swf", "400", "200", "9", "#FFFFFF");
so.addParam("base", ".");
so.write("forcesmoothing");
本文转自
http://www.crydust.be/blog/2008/02/15/forcesmoothing/
forceSmoothing
强迫光滑属性在FLASH里进行伸缩和旋转是很容易的,只要使用_rotation,_xscale,成员。除非你发布一个FB8或者更新的SWF媒体内容,你伸缩或者旋转的每一张图片都会被锯齿化,非常讨厌。为了消除这一点你必须将媒体内容发布为FLASH7获得使用复杂的loadBitmapSmoothed 函数。
当FLASH8.5播放器发布时,他引入一个forceSmoothing 属性,该属性在AS2中也存在,现在我们所做的就是当装载图片的时侯将此属性设置为TRUE,当然不要忘记在FLASH播放器8.5以前的版本中该做法是没有任何效果。
这样做得到的效果很好,下面有一个例子展示这种做法。
Rotating and scaling pictures in flash is easy. Just use _rotation, _xscale and _yscale. Except when you publish an swf for Flash Player 8 or newer. Every image you rotate or scale will become jagged. Very anoying. To remedy this you can either publish for Flash 7 or use a complicated loadBitmapSmoothed function that uses BitmapData.
When Flash Player 8.5 came out it introduced the forceSmoothing property. This property is also available in as2. Now all we need to do is set it to true when we load images. Don’t forget that this will have no effect in Flash players older than version 8.5!
It works quite well. In the example below you can clearly see the left picture is more jagged than the right one.
var so = new SWFObject("http://www.crydust.be/blog/wp-content/uploads/forcesmoothing.swf", "forcesmoothing_swf", "400", "200", "9", "#FFFFFF");
so.addParam("base", ".");
so.write("forcesmoothing");
var outer_mc = this.createEmptyMovieClip("outer_mc", 0); var inner_mc = outer_mc.createEmptyMovieClip("inner_mc", 0); // don't rotate the inner_mc // it will lose its properties when the image is loaded outer_mc._rotation = 45; outer_mc._xscale = 120; outer_mc._yscale = 60; var mcl:MovieClipLoader = new MovieClipLoader(); mcl.addListener({ onLoadInit: function(target:MovieClip){ // this prevents that awfully jagged look target.forceSmoothing = true; } }); mcl.loadClip("image.jpg", inner_mc);
本文转自
http://www.crydust.be/blog/2008/02/15/forcesmoothing/
相关文章推荐
- NV12 图像数据的插值时候旋转
- c#图像旋转和翻转
- 【python图像处理】图像的缩放、旋转与翻转
- 设置android屏幕旋转的时候不重新加载activity
- OpenCV图像操作,缩放,旋转等
- YUV420图像旋转90算法的优化
- matlab旋转图像任意角度
- 第六章 - 图像变换 - 图像拉伸、收缩、扭曲、旋转[1] - 仿射变换(cvWarpAffine)
- leetCode 48.Rotate Image (旋转图像) 解题思路和方法
- python图像旋转代码
- Java图片缩略图裁剪水印缩放旋转压缩转格式-Thumbnailator图像处理
- FS_S5PC100 摄像头 ov9650驱动(图像旋转)
- 【Android开发】图形图像处理技术-旋转、缩放、倾斜和平移图像
- FFmpeg获取视频的旋转角度rotate函数,一定能获取!(要放在解析视频流的时候才能获取)
- Java图片缩略图裁剪水印缩放旋转压缩转格式-Thumbnailator图像处理
- android照相机竖屏显示的图像出现旋转的问题,但成像被拉伸了
- Adobe Acrobat “正在纠偏图像,正在旋转图像,正在分解页面”
- Glide 入门到精通之二十——如何旋转图像
- android.graphics.Camera实现图像的旋转、缩放
- 图像旋转