I have a png file of a polygon shape in white with transparent background, and I have another file with the texture that I want to apply to the polygon dynamically. I did not find a proved way to do so by searching the forum. I do have some idea. But before implementation, I want to make sure it is the right approach. Maybe I missed some obvious things.
How about this:
1. Load the polygon shape into memory;
2. Load the texture into memory;
3. For each pixel in #1. check if it is white, replace it with the corresponding pixel in #2 if yes.
If this is the right direction, can someone point me to specific APIs for doing these steps?