Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

HTML Canvas - drawing images in one colour

4: Adsense

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   

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.



#2 Steve_Segreto   Members   

2060
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   

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   Members   

2060
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.