|
-
Ideas for getting color pixels
I have a flash project that I am currently loading images into a dynamic textbox using HTML tags based on an XML file. Now my question is... Would it be possible while the XML is being parsed and the images generated to grab the pixel data from say the left side of the image(orginal image is 250 x 200 and I want to grab the left side 100px) in order to determine to make the text color black or white (ex: black text will be wrote overtop image if the image is a light color and white text if image is a dark color).
Hopefully that made sense, if you need more explaining ask and I will reply
-
-
oh what do u mean? u want to load part of image?
-
Well you can't grab the pixel data until the images are loaded, but once the images are loaded in you could capture them into a BitmapData object and then evaluate the pixels to determine what color the text should be. Seems like overkill unless you have a lot of images you need to load in, but it is possible, yes.
-
i agree with rdoyle720. It's a bit overkill. Plus it's not because you've got some dark pixels on top left that the whole image is dark?
You already enter info via xml that someone must write somewhere anyway, why not add an attribute 'tint' that would determine the color of your text.
gparis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|