colorfilter

How can I manipulate the camera preview?

安稳与你 提交于 2019-12-17 04:11:03
问题 There are several tutorials out there which explain how to get a simple camera preview up and running on an android device. But i couldn't find any example which explains how to manipulate the image before it's being rendered. What I want to do is implementing custom color filters to simulate e.g. red and/or green deficiency. 回答1: I did some research on this and put together a working(ish) example. Here's what I found. It's pretty easy to get the raw data coming off of the camera. It's

How do I select a region by color in a Bitmap?

五迷三道 提交于 2019-12-11 10:22:43
问题 Please suggest an efficient way to select a region by color in a bitmap. Then replace this selected region-color to your desired color. For example, If an image contains four colors say red, green, yellow, orange. Now suppose user clicked on yellow color, so select yellow colored region surrounding to the clicked position and now replace the yellow color to blue. Hope, I explained the question properly. Kindly comment if need any more clarification. As per my knowledge, bitmap is a memory

Ninepatch scaling wrong when scrolling after applying a Colorfilter?

柔情痞子 提交于 2019-12-07 15:57:14
问题 today i tried to make my listview a bit more dynamic. So i created a white ninepatch-image and added a colorfilter with the .setColorFilter method. That's not the problem. But after applying this, everytime i scroll the Image is scaling wrong (randomly) so lets say my item is 100dp high with some text. After scrolling the item is still 100dp high and all text is shown but the image in the Background only uses 50dp now. Here's my code: here how i set the Colorfilter: orgleftbox = context

How to save an image in sdcard after applying RGB color filter in android

北城余情 提交于 2019-12-07 13:35:41
问题 Presently I am designing an application based on photo editing. While doing this i encountered with a problem i.e. I have gone through a tutorial "how to apply RGB color filter for an image" from this link and this tutorial is very helpful and nice. But the problem is after applying RGB color filter to the image i need to save the changed image in sd card. I have googled a lot for this but didn't found exact thing. Many of them sugested to use paint() But im not getting how to use that. So

setColorFilter is not working sometimes on android drawable

99封情书 提交于 2019-12-06 14:24:30
I am trying to apply color filter on drawable depending on selected primary color in preferences by user. This is the piece of code I am using. getResources().getDrawable(R.drawable.ic_batman_1) .setColorFilter(ColorHelper.getPrimaryColor(), PorterDuff.Mode.OVERLAY); Problem is that, sometimes, this piece of code does not change the color filter of drawable. I have placed this code in my activity (main activity) onCreate and onResume method. So as soon as app launches, I want this color filter to be applied on that drawable but sometimes it is not happening. I also noticed that this problem is

Ninepatch scaling wrong when scrolling after applying a Colorfilter?

依然范特西╮ 提交于 2019-12-06 03:56:29
today i tried to make my listview a bit more dynamic. So i created a white ninepatch-image and added a colorfilter with the .setColorFilter method. That's not the problem. But after applying this, everytime i scroll the Image is scaling wrong (randomly) so lets say my item is 100dp high with some text. After scrolling the item is still 100dp high and all text is shown but the image in the Background only uses 50dp now. Here's my code: here how i set the Colorfilter: orgleftbox = context.getResources().getDrawable(R.drawable.list_bubble); orgleftbox.setColorFilter( 0xff00c0ff, Mode.MULTIPLY );

How to save an image in sdcard after applying RGB color filter in android

落花浮王杯 提交于 2019-12-06 02:45:22
Presently I am designing an application based on photo editing. While doing this i encountered with a problem i.e. I have gone through a tutorial "how to apply RGB color filter for an image" from this link and this tutorial is very helpful and nice. But the problem is after applying RGB color filter to the image i need to save the changed image in sd card. I have googled a lot for this but didn't found exact thing. Many of them sugested to use paint() But im not getting how to use that. So exactly my problem is "After Applying RBG Coloration to image I need to save that image in SD Card, But I

Android color overlay - PorterDuff modes

梦想与她 提交于 2019-12-05 23:11:10
问题 I have a black & white ninepatch drawable as background of a view and I would like to apply a color on it, like a semi-transparent overlay that leaves the drawing visible but applies the desired color on it. I thought drawable.setColorFilter(color,mode) might do the trick, but I can't figure out what the different modes mean. Could anyone give me a hint? 回答1: I believe this question may help you: Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable's Hue That

Android apply colorMatrix colorFilter on part of imageView with a mask

家住魔仙堡 提交于 2019-12-03 01:29:47
I want to change the brightness on certain part of an image. I know how to use ColorMatrix to change the brightness(or hue) of an image. But it will be applied to the whole image. I have a mask file (black and white image). I want to apply the brightness change only on the the white part of that mask.How to do this in Android? Below is a mask image and the result I want to get. for given bitmap and mask: first create a temporary bitmap: bitmap = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.bitmap); mask = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.mask); float[]

StateListDrawable to switch colorfilters

走远了吗. 提交于 2019-11-28 23:44:25
I want to create custom buttons to use in a TabHost. I haven been trying to just use the same image resource (png), but have the colorfilter change depending on the state. So I made this bit to serve as the layout for the custom button: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/tab_icon" android:layout_centerInParent="true" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_width="wrap