-
- kemarofangs
- Posts: 32
- Joined:
Polygon Drawing Problem
Is the polygon class supported? I've tried using it but nothing seems to get drawn. I've even tried a solidcolorbrush but nothing seems to work. Is there a decoration or alternative you can suggest to make this work?
Using V1.2.6.f5
This works...
Yet this wont
Using V1.2.6.f5
This works...
Code: Select all
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
x:Class="Darren.Asteroid"
Width="100" Height="100">
<UserControl.Background>
<ImageBrush ImageSource="../../Raster/Texture/Asteroid.png" />
</UserControl.Background>
</UserControl>
Code: Select all
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
x:Class="Darren.Asteroid"
Width="100" Height="100">
<Polygon>
<Polygon.Fill>
<!-- File path is relative to this file. -->
<ImageBrush ImageSource="../../Raster/Texture/Asteroid.png" />
</Polygon.Fill>
<Polygon.Points>
<PointCollection>
<Point X="20" Y="0" />
<Point X="70" Y="5" />
<Point X="100" Y="20" />
<Point X="80" Y="90" />
<Point X="30" Y="95" />
<Point X="0" Y="50" />
</PointCollection>
</Polygon.Points>
</Polygon>
</UserControl>
Re: Polygon Drawing Problem
For now, only Path and StreamGeometry in its Data property is supported. This is the most efficient way to draw shapes (even on WPF) and is valid for 99% of the cases.
Converting anything to a Path is trivial in Microsoft Blend, just go to the contextual menu of the Figure, Path -> Convert to Path.
For example, for your polygon this would be the equivalent:
Converting anything to a Path is trivial in Microsoft Blend, just go to the contextual menu of the Figure, Path -> Convert to Path.
For example, for your polygon this would be the equivalent:
Code: Select all
<Path Data="M20,0 L70,5 L100,20 L80,90 L30,95 L0,50 z" Fill="Red" Stretch="Fill"/>
Re: Polygon Drawing Problem
You are welcome : )
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest