Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i work with Android EffectFactory Class?

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?

like image 375
Aerrow Avatar asked Apr 05 '13 10:04

Aerrow


2 Answers

try:

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

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

like image 196
Y.AL Avatar answered Nov 20 '22 16:11

Y.AL


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

like image 41
codezjx Avatar answered Nov 20 '22 18:11

codezjx