XAML code to create a human face


XAML code to create a human face in WPF.

XAML code to create a human face.



Create a new WPF window application in WPF and paste the following code to the XAML editor. Place these codes in the window element.


<Grid>
<Canvas Margin="91.685,18.337,101.687,210.042" Name="FaceCanvas" Background="AliceBlue" ToolTip="A Simple Face Created In WPF">

<Canvas.BitmapEffect>

<DropShadowBitmapEffect Color="CadetBlue" Direction="400" />

</Canvas.BitmapEffect>

<Ellipse Canvas.Left="18.337" Canvas.Top="16.67" Height="225.045" Name="ellipse1" Stroke="Black" Width="238.381" Fill="Bisque" />

<Ellipse Canvas.Left="38" Canvas.Top="67" Height="26" Name="ellipse2" Stroke="Black" Width="67" Fill="Azure" />

<Ellipse Canvas.Left="158" Canvas.Top="67" Height="26" Name="ellipse3" Stroke="Black" Width="67" Fill="Azure" />

<Ellipse Canvas.Left="63" Canvas.Top="80" Height="13" Name="ellipse4" Stroke="Black" Width="13" Fill="Black" />

<Ellipse Canvas.Left="186" Canvas.Top="80" Height="13" Name="ellipse5" Stroke="Black" Width="13" Fill="Black" />


<Ellipse Name="ellipse6" Stroke="Black" Width="15" Height="60" Canvas.Left="126" Canvas.Top="103" Fill="BurlyWood" />

<Canvas.LayoutTransform>

<RotateTransform Angle="-20"/>

</Canvas.LayoutTransform>

</Canvas>

</Grid>


When you run the application then the face will look similar to the face in the image.
Face


Comments

Guest Author: Pecez11 Jun 2012

Howdy Darryl,For silverlight 2, have they added WPF dtgdarias out-of-box. I was shocked to find that xceed dtgdarias were needed to use the datagrid WPF control and there is no longer a free version for use. IMO, this is a huge setback for WPF adoption and a possible adoption killer for small shops. If I missed something with this stance, please enlighten.- Johnathan



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: