Tint a image without xml

All your problems with Audio, Video and Images.

Tint a image without xml

Postby cesar09 » Sun Sep 27, 2009 12:44 pm

hey
im running mad with this problem. Since 2 day im trying to tint an image with colorfilter, but nothing happens...
the picture im trying to recolor is a png with a lot of transparent parts in the middle is a little green area with a black outline
i want to tint this green into red blue or anytinhg else ...

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. pic1 = (ImageView) findViewById(R.id.pic1);
  3.  
  4. pic1.setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP);
Parsed in 0.029 seconds, using GeSHi 1.0.8.4


what is wrong ?
...just a freshman...
cesar09
Freshman
Freshman
 
Posts: 8
Joined: Thu Apr 23, 2009 4:34 pm
Location: Germany

Top

Postby cesar09 » Sun Sep 27, 2009 8:22 pm

ok i got it!
just for those who are interested: :)

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. pic1 = (ImageView) findViewById(R.id.pic1);
  3.  
  4. PorterDuffColorFilter red = new PorterDuffColorFilter(Color.RED,PorterDuff.Mode.SRC_ATOP);
  5.  
  6. pic1.getBackground().setColorFilter(red);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
...just a freshman...
cesar09
Freshman
Freshman
 
Posts: 8
Joined: Thu Apr 23, 2009 4:34 pm
Location: Germany

Postby Zeba Momin » Mon Jan 18, 2010 2:22 pm

I tried dis..but dis makes my image red completely!!!
I dont want dat..i jst want to giv a slight tint to my image.
Wat Mode do i use for dis??
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 12 guests