Silverlight TileBrush: Huh?!

168 views
Skip to first unread message

Cory Plotts

unread,
Feb 2, 2010, 5:11:29 PM2/2/10
to WPF Disciples
Ok, I know it isn't nice :) (but it is fun!) ... but I just have to pick on WPF's little sister, Silverlight.
 
How can ImageBrush and/or VideoBrush from TileBrush ... when TileBrush doesn't do any tiling? Uh, what the heck?
 
It doesn't do it in SL2, nor in SL3, and it doesn't look like it will do it in SL4.
 
This is just funny to me. :)
 
p.s.
I know, I know ... it's all about prioritization of features ... but come on ... isn't it funny?

Cory Plotts

unread,
Feb 2, 2010, 5:14:08 PM2/2/10
to WPF Disciples
I meant to say of course:
How can ImageBrush and/or VideoBrush derive from TileBrush ...

Cory Plotts

unread,
Feb 2, 2010, 5:14:55 PM2/2/10
to WPF Disciples
Or maybe I should say:
Why is it named TileBrush? :) Ok, I've gotta stop this.

Sacha Barber

unread,
Feb 3, 2010, 1:59:47 AM2/3/10
to wpf-di...@googlegroups.com
I did see over at codeproject some one created a TileBrush for SL the other day, do not have link, but it was not that long ago
--
Sacha Barber
sacha....@gmail.com

Laurent Bugnion, GalaSoft

unread,
Feb 3, 2010, 4:22:49 AM2/3/10
to wpf-di...@googlegroups.com

The current preferred way of doing special brushes (like tiled brush and visual brush) in Silverlight is to use pixel shaders. I saw one for visual brush already, tiled brush I cannot remember, but that should be easy enough. Honestly I am doubtful that we will ever have visual brush and tiled brush in Silverlight.

 

The base class thing is for code compatibility with WPF. There are many classes in SL that don't make much sense except if you take a few steps back. Honestly  am more concerned by the fact that there are no VideoBrush and ImageBrush in WPF (and also the new HtmlBrush introduced in SL4). I never mind that much when SL misses WPF classes, but when I see classes added to SL and missing in WPF, then the "superset vs subset" story is broken.

 

Cheers,

Laurent

Cory Plotts

unread,
Feb 3, 2010, 10:12:07 AM2/3/10
to wpf-di...@googlegroups.com
On Wed, Feb 3, 2010 at 3:22 AM, Laurent Bugnion, GalaSoft <lau...@galasoft.ch> wrote:

The current preferred way of doing special brushes (like tiled brush and visual brush) in Silverlight is to use pixel shaders. I saw one for visual brush already, tiled brush I cannot remember, but that should be easy enough. Honestly I am doubtful that we will ever have visual brush and tiled brush in Silverlight.

That is what brought this up. That is ... I was playing with a pixel shader that does a tiling effect (like this: http://www.silverlightplayground.org/post/2009/03/22/Silverlight-30-Tile-Effect-with-a-Pixel-Shader.aspx).
 
However, I wanted to tile a brush in a non-rectangular Path. But ... applying the tiling effect to the Path cause the rectangular bounding box around the Path to be tiled. See this image for more info: http://farm5.static.flickr.com/4027/4328053484_4740b18a00_o.png
 
So, it appears that using an effect to do tiling in Silverlight ... has its limits. (Unless one of you has a great idea that I'm missing. :) One other thought I had was to use the tile effect against a rectangle but then to clip to the geometry I want. I haven't tried that yet, though.)
 

The base class thing is for code compatibility with WPF. There are many classes in SL that don't make much sense except if you take a few steps back. Honestly  am more concerned by the fact that there are no VideoBrush and ImageBrush in WPF (and also the new HtmlBrush introduced in SL4). I never mind that much when SL misses WPF classes, but when I see classes added to SL and missing in WPF, then the "superset vs subset" story is broken.

Yes, I totally understand that it is there for code compatibility with WPF. Even knowing that ... it was still funny to me. :) Heh, heh, I must have a sick sense of humor.
 
And, I completely agree about your concerns where Silverlight has more functionality than WPF (like VideoBrush/HtmlBrush). That makes me cry.

Cory Plotts

unread,
Feb 3, 2010, 10:17:24 AM2/3/10
to wpf-di...@googlegroups.com
Hmm. The flickr farm link cuts out my comments on the image ... here is a better link so you can see the comments:
Reply all
Reply to author
Forward
0 new messages