我该如何与And​​roid EffectFactory类工作? [英] How can i work with Android EffectFactory Class?

查看:209
本文介绍了我该如何与And​​roid EffectFactory类工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我累了发展与图像处理的示例应用程序,在我的应用程序,我需要补充一些色彩效果(灰度,深褐色)在我的位图我提到的开发文档文档1 和<一href="http://developer.android.com/reference/android/media/effect/EffectFactory.html#EFFECT_VIGNETTE">Doc 2 ,本文件中没有实际的例子,所以需要知道我们是否可以使用这个类添加复古,怀旧色彩效果,任何一个指导我请,先谢谢了。

I tired to Develop a sample application with image processing, in my app i need to add some color effects (Grayscale, sepia) over my bitmap i referred the developer documents Doc 1 and Doc 2, in this document there is no practical examples, so need to know whether we can add Vintage,Sepia color effects using this class, any one guide me please, Thanks in advance.

更新:

我试过这样的,

private EffectContext mEffectContext;

Bitmap b1 = BitmapFactory.decodeResource(getResources(),
                        R.drawable.sample);
EffectFactory effectFactory = mEffectContext.getFactory();
                Effect mEffect = effectFactory
                        .createEffect(EffectFactory.EFFECT_SEPIA);

现在我怎样才能设置mEffect我的位图?

Now how can i set the mEffect to my bitmap?

推荐答案

尝试:

Effect mEffect= effectFactory.createEffect(EffectFactory.EFFECT_SEPIA);

然后使用GLSurfaceView显示渲染效果,<一个href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android-apps/4.1.1_r1/com/example/android/mediafx/HelloEffects.java"相对=nofollow>此处是你所需要的。

这篇关于我该如何与And​​roid EffectFactory类工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆