HTML Canvas - drawing images in one colour

Started by
2 comments, last by Steve_Segreto 11 years ago

Sorry if this is not the right forum, couldn't identify one to be html specific.

Simply put, how can I draw an image with transparency info, so that all non-transparent pixels are drawn using a given colour?

thanks

r.

Advertisement

http://stackoverflow.com/questions/2359537/how-to-change-the-opacity-alpha-transparency-of-an-element-in-a-canvas-elemen

http://stackoverflow.com/questions/2359537/how-to-change-the-opacity-alpha-transparency-of-an-element-in-a-canvas-elemen

thanks - but, I may be slow.. i can't see a proper solution unless it is pixel by pixel alteration, in that link. is that the case?

I believe that link says its as easy as changing the canvas' context data, specifically the GlobalAlpha value.

e.g.

context.globalAlpha = 0.5f; // Half transparency

Am I missing something?

This topic is closed to new replies.

Advertisement