I'm not sure of this, but:  After you grab "val" you could bitshift out the
alpha channel ("a"), subtract that from the original argb value to remove
the alpha channel.  Manipulate "a" and bitshift it back up again before
adding it to the rgb value to give you a new argb.


var a:uint = val >> 32 & 0xff;
var rgb:uint = val - (a << 32);
a = a / 2;
var newval:uint = rgb + (a << 32);



--------------------------------
Andrew Murphy
Interactive Media Specialist
[EMAIL PROTECTED]

Delvinia
214 King Street West, Suite 214 
Toronto Canada M5H 3S6

P 416.364.1455 ext. 232  F 416.364.9830  W www.delvinia.com

CONFIDENTIALITY NOTICE
This email message may contain privileged or confidential information. If
you are not the intended recipient or received this communication by error,
please notify the sender and delete the message without copying or
disclosing it.

AVIS DE CONFIDENTIALITÉ
Ce message peut contenir de l'information légalement privilégiée ou
confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu par
erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en
détruire le contenu sans le communiquer a d'autres ou le reproduire.

 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of sebastian
> Sent: Monday, October 06, 2008 3:18 PM
> To: Flash Coders List
> Subject: [Flashcoders] working with getPixel32 and setPixel32,
> 
> hi folks,
> 
> can any one shed some light to me on the setpixel32 and getpixel32?
> 
> I'd like to be able to affect just one of the 4 components: A 
> R G or B independently of another.
> 
> Essentially, read the current ARGB using getPixel32 and then 
> manipulate just one part of it, in my case, halve the current 
> "A" value of the ARGB and then re-assign it back to the bitmap.
> 
> 
> //1: grab the HEX value for the current coordinate:
> var val:uint = getPixel32(x,y);
> 
> //2: manipulate the HEX value of just 1 of the 4 parts, in my 
> case the A of the ARGB:
> ????
> 
> //3: re-assign it back to the display:
> setPixel32(x,y,val);
> 
> Thanks for your help!
> 
> Sebastian.
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to