Hello,
I'm evaluating RadControls for WPF.
My program need many custom shapes like visio stencil.
I want to convert vector images into custom shapes for diagram.
What I did is as follows.
1. Convert sample wmf file into xaml file with MS Expression Design 4
Export-Format as XAML WPF Canvas
2. I refered CustomShapeExample and inserted xaml code in Generic.xaml by MSED4 for my own custom shape.
<Style TargetType="local:MyFirstShape">
<Setter Property="BorderThickness" Value="4" />
<Setter Property="BorderBrush" Value="#6C666666" />
<Setter Property="Width" Value="350" />
<Setter Property="Height" Value="300" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Margin" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:MyFirstShape">
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Document" Width="190.904" Height="179.643" Clip="F1 M 0,0L 190.904,0L 190.904,179.643L 0,179.643L 0,0">
<Canvas x:Name="MC900295085" Width="799.598" Height="599.808" Canvas.Left="0" Canvas.Top="0">
<Path x:Name="Path" Width="92.3327" Height="66.4918" Canvas.Left="98.5714" Canvas.Top="98.588" Stretch="Fill" Fill="#ED000000" Data="M 190.904,159.906L 190.232,160.002L ..... 190.904,159.906 Z "/>
...
...
...
</Canvas>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
3. Then I could load it's image in a diagram, but it didn't resize.
Question.
We need to make custom shapes with vector image. Could you tell me the best way for this?
Regards,
I'm evaluating RadControls for WPF.
My program need many custom shapes like visio stencil.
I want to convert vector images into custom shapes for diagram.
What I did is as follows.
1. Convert sample wmf file into xaml file with MS Expression Design 4
Export-Format as XAML WPF Canvas
2. I refered CustomShapeExample and inserted xaml code in Generic.xaml by MSED4 for my own custom shape.
<Style TargetType="local:MyFirstShape">
<Setter Property="BorderThickness" Value="4" />
<Setter Property="BorderBrush" Value="#6C666666" />
<Setter Property="Width" Value="350" />
<Setter Property="Height" Value="300" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Margin" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:MyFirstShape">
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Document" Width="190.904" Height="179.643" Clip="F1 M 0,0L 190.904,0L 190.904,179.643L 0,179.643L 0,0">
<Canvas x:Name="MC900295085" Width="799.598" Height="599.808" Canvas.Left="0" Canvas.Top="0">
<Path x:Name="Path" Width="92.3327" Height="66.4918" Canvas.Left="98.5714" Canvas.Top="98.588" Stretch="Fill" Fill="#ED000000" Data="M 190.904,159.906L 190.232,160.002L ..... 190.904,159.906 Z "/>
...
...
...
</Canvas>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
3. Then I could load it's image in a diagram, but it didn't resize.
Question.
We need to make custom shapes with vector image. Could you tell me the best way for this?
Regards,