SFML community forums

Help => Graphics => Topic started by: Dark Byte on September 29, 2010, 02:46:51 am

Title: How can I 'mask' an image
Post by: Dark Byte on September 29, 2010, 02:46:51 am
Is it possible to mask an image (if a pixel in the image is a specific color it is invisible)?
Title: How can I 'mask' an image
Post by: Spodi on September 29, 2010, 03:10:34 am
I don't think there is any simple way to actually apply a mask in the traditional sense of a mask, but you can set an image to make a certain color transparent with sf::Image::CreateMaskFromColor (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Image.htm#777c411024de586400181954deadd24d).
Title: How can I 'mask' an image
Post by: Dark Byte on September 29, 2010, 03:40:41 am
Thank you exactly what I needed.