colorfilter

What is the best way to apply color filter on hair style with some specified hair style image pattern?

。_饼干妹妹 提交于 2019-11-28 09:28:42
I am developing an android application for hair style salon.I am having two images. One is hairstyle (hair) and another is hair color pattern. I am able to change the color of hair style based on specific rgb value. My code is as below: int color = Color.rgb(182,132, 84); // getting rgb value Paint paint = new Paint(); paint.setColorFilter(new LightingColorFilter(color, 1)); transform.reset(); transform.postTranslate(-width / 2.0f, -height / 2.0f); transform.postRotate(getDegreesFromRadians(angle)); transform.postScale(scale, scale); transform.postTranslate(position.getX(), position.getY());

setColorFilter not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 21:01:47
I'm trying to implement a simple colorfilter on an imageview to turn the black image into a white image. In order to achieve that I do the following: weatherImg.setColorFilter(Color.BLACK, PorterDuff.Mode.MULTIPLY); weatherImg.setImageResource(R.drawable.b_clouded_rain); I've also tried to change to color in the color filter to red and white but all of them have no effect, what am I doing wrong? As much as I hate to answer my own questions I found the problem: I should've used: weatherImg.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP); It depends on what kind of filtering you want to

Applying ColorFilter to ImageView with ShapedDrawable

浪尽此生 提交于 2019-11-26 22:06:50
I have an ImageView with android:src set to a ShapedDrawable , namely a white circle. What I want is to colorize this ImageView in runtime responding to some events. imgView.setColorFilter seems to be solution, but after using this (tried different parameters) the image becomes invisible (I don't see it at the screen). How to solve this? And are there better ways to have color circles? Alright, I had a quick play with this and noticed your issue of the circles disappearing. Without you describing what exactly you tried, I assume you haven't tried setting the color filter to the Drawable itself

How can I manipulate the camera preview?

白昼怎懂夜的黑 提交于 2019-11-26 18:08:04
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. 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 returned as a YUV byte array. You'd need to draw it manually onto a surface in order to be able to modify it. To

Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable's Hue

点点圈 提交于 2019-11-26 01:36:50
问题 I\'m working on a UI for an app, and I\'m attempting to use grayscale icons, and allow the user to change the theme to a color of their choosing. To do this, I\'m trying to just apply a ColorFilter of some sort to overlay a color on top of the drawable. I\'ve tried using PorterDuff.Mode.MULTIPLY, and it works almost exactly as I need, except that whites get overlayed with the color as well. What I\'m ideally looking for is something like the \"Color\" blending mode in Photoshop, where the