it uses copyChannel method fro BitmapData class (1 = red, 2 = green, 4 =
blue, 8 = alpha)

import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
var background_bmp:BitmapData = new BitmapData(this._width, this._height);
 background_bmp.draw(blackWhite);
 blackWhite.attachBitmap(background_bmp, 1);
 //Medium Grayscale
 background_bmp.copyChannel(background_bmp, background_bmp.rectangle, new
Point(0, 0), 2, 1);
 background_bmp.copyChannel(background_bmp, background_bmp.rectangle, new
Point(0, 0), 2, 2);
 background_bmp.copyChannel(background_bmp, background_bmp.rectangle, new
Point(0, 0), 2, 4);

[]'s
Leandro Amano

On 5/9/07, Mike Mountain <[EMAIL PROTECTED]> wrote:

Hey guys

I'm working with greyscale images - assume neutral colour temperature is
50%
grey. These are shaded from white to black, white representing light,
black
shading, and all the variable shades in between etc.

I need to tint the greyscale bitmapData to produce a shaded coloured image
using the colorMatrixFilter() from an RGB or Hex value.

so if the whole image was 50% grey (ie. r=128, g=128, b=128) it should
become r=256,g=0,b-0 - black should stay black, white should stay white
but
the colours in between should be shades of red.

Anyone got a clue how I can do this?

Cheers

Mike
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
--
Leandro Amano
Digital Bug
Chief Creative Officer
Adobe Certified Expert
Adobe Certified Instructor
Adobe User Group Leader
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to