小游戏不支持 小程序不支持

模糊滤镜

Properties

Events

Extends annie.AOjbect
Defined in: libs/Filters.js:475
Module: annie

Available since 1.0.0

Methods

BlurFilter

BlurFilter
(
  • blurX
  • blurY
  • quality
)
public

Defined in libs/Filters.js:485

Available since 1.0.0

小游戏不支持 小程序不支持

Parameters:

nametypeflagdescription
blurX Number
blurY Number
quality Number

Example:

 var imgEle = new Image();
      imgEle.onload = function (e) {
  var rect = new annie.Rectangle(0, 0, 200, 200),
      rectBitmap = new annie.Bitmap(imgEle, rect);
      rectBitmap.x = (s.stage.desWidth - bitmap.width) / 2;
      rectBitmap.y = (s.stage.desHeight - bitmap.height) / 2;
      var blur=new annie.BlurFilter(30,30,1);//实例化模糊滤镜
      rectBitmap.filters=[blur];//为bitmap添加模糊滤镜效果
      s.addChild(rectBitmap);
  }
  imgEle.src = 'http://test.annie2x.com/biglong/logo.jpg';

drawFilter

drawFilter
(
  • imageData
)
public

Defined in libs/Filters.js:564

Available since 1.0.0

绘画滤镜效果

Parameters:

nametypeflagdescription
imageData ImageData

toString

toString () String public

Defined in libs/Filters.js:553

Available since 1.0.0

获取滤镜的字符串表现形式以方便比较两个滤镜是否效果一样

Returns:

String:

Properties

blurX

Number public

Defined in libs/Filters.js:520

Available since 1.0.0

水平模糊量

blurY

Number public

Defined in libs/Filters.js:529

Available since 1.0.0

垂直模糊量

quality

Number public

Defined in libs/Filters.js:538

Available since 1.0.0

模糊品质

type

String public

Defined in libs/Filters.js:511

Available since 1.0.0

滤镜类型 只读

Top