How can i work with Android EffectFactory Class?

2020-06-03 04:13发布

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.

Update:

I tried like this,

private EffectContext mEffectContext;

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

Now how can i set the mEffect to my bitmap?

2条回答
孤傲高冷的网名
2楼-- · 2020-06-03 04:31

try:

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

Then use GLSurfaceView to show the rendered effects, here is an example of what you need

查看更多
够拽才男人
3楼-- · 2020-06-03 04:54

You can find the official sample project HelloEffects in android-sdk-windows\samples\android-17

查看更多
登录 后发表回答