本文介绍了如何在位图上应用不同的图像效果(滤镜),如棕褐色,黑白,模糊等?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何对图像应用不同的效果,

I am not having any idea of how to apply different effect on Image,

我见过类和类有一种方法
但是我不确定在inputTexId和optputTexId中传递什么,以及从哪里获得新的更新的图像,如何在imageView中存储更新的图像,

I have seen the EffectFactory class and Effect class in effect class there is one method applybut I am not sure what to pass in inputTexId and optputTexId, and from where I get the new updated image, how to store the updated image in imageView,

请帮我解决这个问题。
是否有可用于提供图像效果的开源库。

Please help me with how to approach this problem.Is there any opensource library available for providing effects on Image.

谢谢,

推荐答案

我已实施

Download AndroidJars.

修改

Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
//Find the bitmap's width height
int width = AndroidUtils.getBitmapOfWidth(getResources(), R.drawable.ic_launcher);
int height = AndroidUtils.getBitmapOfHeight(getResources(), R.drawable.ic_launcher);
//Create a filter object.
GaussianFilter filter = new GaussianFilter();
//set???? function to specify the various settings.
filter.setRadius(8.5f);
//Change int Array into a bitmap
int[] src = AndroidUtils.bitmapToIntArray(bitmap);
//Applies a filter.
filter.filter(src, width, height);
//Change the Bitmap int Array (Supports only ARGB_8888)
Bitmap dstBitmap = Bitmap.createBitmap(src, width, height, Config.ARGB_8888);

Find more detailed information at Android-jhlabs

这篇关于如何在位图上应用不同的图像效果(滤镜),如棕褐色,黑白,模糊等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 06:13