Silverlight Blending Modes Workaround RRS feed

  • Question

  • Ok, so I really cannot grasp how Expression Blend cannot offer support for blending modes as a WYSIWYG, design-time implementation tool. This is surely something that will put off designer/integrators that don't have a strong (or any) background in development or coding (such as myself), encouraging them to opt for technologies that do support these abilities.

    But that's enough ranting before I get into trouble.

    So, I'm actually hoping to find out whether there is anybody that can help me with a workaround in using blending modes.

    I got my hands on Cory Plott's Silverlight library of Blend Modes (kudos to him for assembling that library, really think he did a good job). However, as those of you familiar with his library would know, the problem is that for the effects to work you need to input a source which gets fitted to the element you're applying the effect.

    Is there anybody who can suggest how to get elements to simulate the blending modes in a way that an image/video editing program such as Photoshop typically would (ie applying an effect/mode/behavior to an element once that would affect all "layers" below it). Preferably one that doesn't require too much backend coding, because I'm likely going to have to count on step-by-step instructions on getting this thing working properly.

    Thanks in advance to anybody that can help me out here!

    Wednesday, September 1, 2010 8:49 AM

All replies

  • Hi KapteinWenner,

    Thanks for your nice words on my blend mode library! :)

    Unfortunately, there are limitations to what my blend mode library can do (especially on Silverlight). My suggestion is to vote for these features ... that they be built into the platforms. Here is the link to the Silverlight UserVoice forum. Here is the link to the WPF UserVoice forum.

    Back to limitations ... in WPF, I used a behavior from Jeremiah Morril that I renamed the BackgroundEffectBehavior. This behavior allows one to blend the B (upper) layer into the A (lower layer) ... where both layers have different geometries. The unfortunate thing is that this behavior is implemented with VisualBrush(es) which is not something available in Silverlight. Thus, blending two layers of differing geometries is not supported in the Silverlight version of my blend mode library.

    However, even with the BackgroundEffectBehavior ... my blend mode library won't necessarily be able to blend a layer into all layers below it. There are some tricks to 'fake' this ... but basically, the BackgroundEffectBehavior only blends the upper layer with one lower layer.

    In essence ... to answer your question: it is not possible, given the current frameworks, to do what you are asking ... namely, to blend an element into all layers beneath it ... using a blend mode. Blend modes need to be built into the platforms.

    Hope that helps or at least clarifies :) ...



    Tuesday, February 1, 2011 5:04 PM