Building image filtering feature is easy with GPUImage for Android.
Here's the github repo https://github.com/CyberAgent/android-gpuimage
You simple have to do this in xml:
And in code
if you want to apply a filter, like a contrast filter.
Although it's herriated from FrameLayout, you can still setScaleType like a ImageView
Pretty cool and easy to use, right?
Here's the github repo https://github.com/CyberAgent/android-gpuimage
You simple have to do this in xml:
<jp.co.cyberagent.android.gpuimage.GPUImageView
android:id="@+id/iv_filter_thumb"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_above="@+id/tv_filter_name" />
And in code
GPUImageView img = (GPUImageView) view.findViewById(R.id.iv_filter_thumb);
if you want to apply a filter, like a contrast filter.
giv.setFilter(new GPUImageContrastFilter(1.75f));
Although it's herriated from FrameLayout, you can still setScaleType like a ImageView
img.setScaleType(GPUImage.ScaleType.CENTER_CROP);
Pretty cool and easy to use, right?
沒有留言:
張貼留言