斜角滤镜

Flash Player 9 和更高版本,Adobe AIR 1.0 和更高版本

BevelFilter 类可为过滤的对象添加 3D 斜角边缘。此滤镜可使对象的硬角或边缘具有硬角或边缘被凿削或呈斜面的效果。

BevelFilter 类属性允许您自定义斜角的外观。您可以设置加亮和阴影颜色、斜角边缘模糊、斜角角度和斜角边缘的位置,甚至可以创建挖空效果。

以下示例加载外部图像并对它应用斜角滤镜。

import flash.display.*; 
import flash.filters.BevelFilter; 
import flash.filters.BitmapFilterQuality; 
import flash.filters.BitmapFilterType; 
import flash.net.URLRequest; 
 
// Load an image onto the Stage. 
var imageLoader:Loader = new Loader(); 
var url:String = "http://www.helpexamples.com/flash/images/image3.jpg"; 
var urlReq:URLRequest = new URLRequest(url); 
imageLoader.load(urlReq); 
addChild(imageLoader); 
 
// Create the bevel filter and set filter properties. 
var bevel:BevelFilter = new BevelFilter(); 
 
bevel.distance = 5; 
bevel.angle = 45; 
bevel.highlightColor = 0xFFFF00; 
bevel.highlightAlpha = 0.8; 
bevel.shadowColor = 0x666666; 
bevel.shadowAlpha = 0.8; 
bevel.blurX = 5; 
bevel.blurY = 5; 
bevel.strength = 5; 
bevel.quality = BitmapFilterQuality.HIGH; 
bevel.type = BitmapFilterType.INNER; 
bevel.knockout = false; 
 
// Apply filter to the image. 
imageLoader.filters = [bevel];