Flex colorizer: using ColorTransform class to colorize objects at run-time

Posted by Unknown Senin, 18 Juli 2011 0 komentar
In this post I wanted to show you a nice trick how to colorize visual object at run-time.
Colorizing of the plain object (e.g. rectangle) is very simple:

var colorTransform:ColorTransform = new ColorTransform();
colorTransform.color = color;
target.transform.colorTransform = colorTransform;

But what if you need to colorize some complex object (e.g. image of the rooftop)?


Solution...


1. Prepare color layer (area that you want to colorize) and save it as a separate image

2. Place color layer image over the original image with blendMode="normal"
3. Apply colorization for color layer image:

var colorTransform:ColorTransform = new ColorTransform();
colorTransform.color = color;
target.transform.colorTransform = colorTransform;

Results:





TERIMA KASIH ATAS KUNJUNGAN SAUDARA
Judul: Flex colorizer: using ColorTransform class to colorize objects at run-time
Ditulis oleh Unknown
Rating Blog 5 dari 5
Semoga artikel ini bermanfaat bagi saudara. Jika ingin mengutip, baik itu sebagian atau keseluruhan dari isi artikel ini harap menyertakan link dofollow ke http://androidillegal.blogspot.com/2011/07/flex-colorizer-using-colortransform.html. Terima kasih sudah singgah membaca artikel ini.

0 komentar:

Posting Komentar

Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android illegal.