Click here to Skip to main content
15,877,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to set a background image and repeat only vertical on y.

my code is
XML
<Window.Background>
    <ImageBrush ImageSource="images/window_bg.png" 
    ViewportUnits="Absolute"
    Viewport="0,0,186,2" 
    TileMode="FlipY"
    Stretch="UniformToFill"
    AlignmentX="Left"
    AlignmentY="Top" />
</Window.Background>


What's going wrong
Posted
Comments
Sergey Alexandrovich Kryukov 3-Jan-13 18:24pm    
I hope, "repeat-y" was just for analogy, right? :-)
—SA

1 solution

This looks like the answer: http://stackoverflow.com/questions/1782979/wpf-how-do-i-create-a-background-that-repeats-horizontally-without-scalling[^].

As you want "repeat-y", not x, flip x and y in the code.

Please try.

—SA
 
Share this answer
 
v2
Comments
Espen Harlinn 3-Jan-13 18:45pm    
Nice :-D
Sergey Alexandrovich Kryukov 3-Jan-13 18:56pm    
Thank you, Espen.
Happy New Year!
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900