如何应用KineticJS过滤器?

编程入门 行业动态 更新时间:2024-10-26 20:24:36
本文介绍了如何应用KineticJS过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我发现KineticJS过滤器文档非常令人沮丧,并且无法在线找到示例,尤其是考虑到亮度.

I find the KineticJS filters documentation extremely frustrating and could not find examples online, especially considering brightness.

dynamic.filters文档链接提到Kinetic.Filters.Brighten( imageData),但没有有关如何向其传递参数或如何使用它的信息.

The kinetic.filters docs link mention a Kinetic.Filters.Brighten(imageData) but there's no info on how to pass parameters to it or how to use it.

我需要的是一个在舞台上的图层上的图像的工作示例,以及两个按钮-一个使图像更亮,一个使图像更暗.有人可以帮我吗?

All I need is a working example of an image on a layer on a stage, and two buttons - one to make the image brighter and one to make it darker. Can anyone please help me with that ?

谢谢!

推荐答案

确实,有关过滤器的文档很差.

Realy, documentation for filters is poor.

增亮滤镜示例:(kineticjs 4.5.0)

Example for Brighten filter: (kineticjs 4.5.0)

darth = new Kinetic.Image({ x: 10, y: 10, image: imageObj, draggable: true, filter: Kinetic.Filters.Brighten, filterBrightness: -50 });

要制作动画,您可以使用本教程: http ://www.html5canvastutorials/kineticjs/html5-canvas-tween-blur-filter-with-kineticjs/

for animate you can use this tutorial: www.html5canvastutorials/kineticjs/html5-canvas-tween-blur-filter-with-kineticjs/

var tween = TweenLite.to(darth, 0.6, { paused: true, setFilterBrightness: 50, onUpdate: function() { layer.batchDraw(); } });

更多推荐

如何应用KineticJS过滤器?

本文发布于:2023-11-23 01:51:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619676.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:过滤器   KineticJS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!