开发者

How to apply effects to camera images?

How can we apply effects like a sepia filter to ou开发者_Go百科r camera images?


Get a Basic idea in this url http://www.riagora.com/2010/07/android-air-and-the-camera/

and then refer android graphics which helps you to know about BlurMaskFilter and color Filter and so on.. http://developer.android.com/reference/android/graphics/package-summary.html.

After getting the basic idea from the first url, try to apply these filter in that.


Please see the code below.This will help

if (mCamera != null) {


                    Camera.Parameters parameters = mCamera.getParameters();

                    if(parameters.getColorEffect() != null) {

                        // Set all kind of stuffs here..
                        parameters.setSceneMode(Camera.Parameters.FLASH_MODE_AUTO);
                        parameters.setColorEffect(Camera.Parameters.EFFECT_SEOIA);

                        mCamera.setParameters(parameters);
                        mPicture = getPictureCallback();
                        mPreview.refreshCamera(mCamera);
                    }else
                    {
                        Toast toast = Toast.makeText(myContext, "Your Camera Does Not Support Color Effect!", Toast.LENGTH_LONG);
                        toast.show();
                    }

                }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜