Jump to content

  • Log In with Google      Sign In   
  • Create Account


HTML Canvas - drawing images in one colour


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 resle2   Members   -  Reputation: 102

Like
0Likes
Like

Posted 08 April 2013 - 12:40 AM

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.



Sponsor:

#2 Steve_Segreto   Crossbones+   -  Reputation: 1513

Like
0Likes
Like

Posted 08 April 2013 - 01:03 AM

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



#3 resle2   Members   -  Reputation: 102

Like
0Likes
Like

Posted 08 April 2013 - 05:12 PM

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?



#4 Steve_Segreto   Crossbones+   -  Reputation: 1513

Like
0Likes
Like

Posted 10 April 2013 - 02:44 PM

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?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS