1

I have this Image:

ArrowImage

I want the image to have a border If I do:

<Border BorderThickness="1" BorderBrush="Black" HorizontalAlignment="Right" Width="22" VerticalAlignment="Center">
            <Image Source="/<AppName>;component/Images/Background/Achtergrond_Arrow.png" HorizontalAlignment="Right" Width="22" >
                <Image.Effect>
                    <DropShadowEffect Color="#FF868686" Direction="0" ShadowDepth="0" BlurRadius="10"  />
                </Image.Effect>
            </Image>
        </Border>

it gives a Square border, not following the arrow itself.

Square Image

Does anybody have any idea on how to fix this??

H.B.
  • 166,899
  • 29
  • 327
  • 400
Zarkos
  • 457
  • 10
  • 30

3 Answers3

3

Don't use an image but draw the border and triangle yourself. You can use a Path, a Line and other basic geometric shapes for this.

This post may give you a starting point. Or a Petzold blog post can give you further assistance.

Community
  • 1
  • 1
Youp Bernoulli
  • 5,303
  • 5
  • 39
  • 59
1

The Border in WPF is always rectangular.

If you want an outline you will have to draw it or use an effect

Emond
  • 50,210
  • 11
  • 84
  • 115
1

My solution:

<Path Fill="Black" Data="M 0 44 L 22 22 L 0 0 Z"  HorizontalAlignment="Right" VerticalAlignment="Center" Width="22" >
        <Path.Effect>
            <DropShadowEffect Color="#FF868686" Direction="0" ShadowDepth="0" BlurRadius="10"  />
        </Path.Effect>
    </Path>

I threw the arrow image away.

Thanks anyway

Zarkos
  • 457
  • 10
  • 30