Blending and Brushes in Silverlight

2009-12-17

I'm in the process of converting a Flash site to Silverlight 3 and I just couldn't get the gradients right on my opacity mask. After talking to the flash developer he reminded me that he didn't use opacity masks but a multiply effect. I thought to myself "game over, Silverlight doesn't support blend modes."

I knew about SL3's support for custom shaders, but I was surprised to find Corey Plotts' library of blending effects for Silverlight, including Multiply. With Silverlight there are always caveats, and this has a fairly big one: you can only use VideoBrushes and ImageBrushes for effect inputs. That means in order for me to have a dynamic color applied to my blend I have to use the WriteableBitmap class to render my Grid's contents to a BitmapImage, then apply that to the MultiplyEffect as an ImageBrush. Will it work? It should, but I think I'll take a nice long winter break before I give it a shot.

Add a comment here. Comments are moderated, your comment will appear within a few hours.