views:

290

answers:

1

I would like to create a background for my window which is an image that i want repeated horizontally. So far I've tried with the ImageBrush, but this option repeats the image horizonally and vertically. Also, i don't want it to scale when user resize the window, as it makes the image look funny.

any ideas?

+1  A: 

You can look into creating a tiling brush:

http://mark-dot-net.blogspot.com/2007/06/creating-hatched-patterned-brush-in-wpf.html

I can probably place an image inside a brush.

decasteljau
the problem is that the tiling brush will repeat the image horizontally and vertically. i just want it horizontally...
federubin
I see. That would be a hack, but maybe you could place the image inside a container (ie. a rectangle) that has an extremely high height. That would make the Y axis to have only one occurrence of the tile.
decasteljau
i thought about that, but i wanted a background that can be saved in a resource dicctionary. if i put a rectangle inside a visualBrush im back to square one, since the rectangle will be repeated in all axis
federubin