Click here to Skip to main content
12,629,804 members (32,928 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: XAML WPF Templates
I want to set a background image and repeat only vertical on y.

my code is
<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 3-Jan-13 4:02am
Comments
   
I hope, "repeat-y" was just for analogy, right? :-)
—SA

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2
Comments
Espen Harlinn 3-Jan-13 18:45pm
   
Nice :-D
   
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.161205.3 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100