Path with Shadow : Path « Windows Presentation Foundation « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Windows Presentation Foundation » Path 




Path with Shadow
Path with Shadow
  

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:src="clr-namespace:WpfApplication1.TextGeometryDemo" 
        Title="TextGeometry Demo">
    <Window.Resources>
        <src:TextGeometry x:Key="txtHollow" Text="Hollow"
                          FontFamily="Times New Roman" 
                          FontSize="192" FontWeight="Bold" />
        
        <src:TextGeometry x:Key="txtShadow" Text="Shadow"
                          FontFamily="Times New Roman"
                          FontSize="192" FontWeight="Bold" />
    </Window.Resources>

    <TabControl>
        <TabItem Header="Shadow">
            <Canvas>
                <Path Fill="DarkGray"
                      Data="{Binding Source={StaticResource txtShadow},Path=Geometry}"
                      Canvas.Left="12" Canvas.Top="12" />
                <Path Stroke="Black" Fill="White" 
                      Data="{Binding Source={StaticResource txtShadow},Path=Geometry}" />
            </Canvas>
        </TabItem>


    </TabControl>
</Window>
//File:Window.xaml.vb
Imports System
Imports System.Globalization
Imports System.Windows
Imports System.Windows.Media

Namespace WpfApplication1.TextGeometryDemo
  Public Class TextGeometry
    Private txt As String = ""
    Private fntfam As New FontFamily()
    Private fntstyle As FontStyle = FontStyles.Normal
    Private fntwt As FontWeight = FontWeights.Normal
    Private fntstr As FontStretch = FontStretches.Normal
    Private emsize As Double = 24
    Private ptOrigin As New Point(00)

    Public Property Text() As String
      Get
        Return txt
      End Get
      Set
        txt = value
      End Set
    End Property
    Public Property FontFamily() As FontFamily
      Get
        Return fntfam
      End Get
      Set
        fntfam = value
      End Set
    End Property
    Public Property FontStyle() As FontStyle
      Get
        Return fntstyle
      End Get
      Set
        fntstyle = value
      End Set
    End Property
    Public Property FontWeight() As FontWeight
      Get
        Return fntwt
      End Get
      Set
        fntwt = value
      End Set
    End Property
    Public Property FontStretch() As FontStretch
      Get
        Return fntstr
      End Get
      Set
        fntstr = value
      End Set
    End Property
    Public Property FontSize() As Double
      Get
        Return emsize
      End Get
      Set
        emsize = value
      End Set
    End Property
    Public Property Origin() As Point
      Get
        Return ptOrigin
      End Get
      Set
        ptOrigin = value
      End Set
    End Property

    Public ReadOnly Property Geometry() As Geometry
      Get
        Dim formtxt As New FormattedText(Text, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, New Typeface(FontFamily, FontStyle, FontWeight, FontStretch), FontSize, Brushes.Black)

        Return formtxt.BuildGeometry(Origin)
      End Get
    End Property

    Public ReadOnly Property PathGeometry() As PathGeometry
      Get
        Return PathGeometry.CreateFromGeometry(Geometry)
      End Get
    End Property

  End Class
End Namespace

   
    
  














Related examples in the same category
1.Trivial PathTrivial Path
2.Path DataPath Data
3.A Path based on Path.Data, PathGeometry and LineSegmentA Path based on Path.Data, PathGeometry and LineSegment
4.Path StrokeDashArrayPath StrokeDashArray
5.Sample ArcSample Arc
6.Four Overlapping CirclesFour Overlapping Circles
7.Path IntersectPath Intersect
8.Closed PathFigureClosed PathFigure
9.PathGeometry FigurePathGeometry Figure
10.Path with OuterGlowBitmapEffectPath with OuterGlowBitmapEffect
11.Path with M, C and ZPath with M, C and Z
12.Path and PolyLineSegment.PointsPath and PolyLineSegment.Points
13.Double animation with pathDouble animation with path
14.Matrix animation with pathMatrix animation with path
15.Create a polyline with a PathGeometryCreate a polyline with a PathGeometry
16.Expanding CirclesExpanding Circles
17.Simple ArcSimple Arc
18.Draw a Curved Line with PathFigure, LineSegment, ArcSegmentDraw a Curved Line with PathFigure, LineSegment, ArcSegment
19.LineSegment inside a PathFigureLineSegment inside a PathFigure
20.ArcSegment inside a PathFigureArcSegment inside a PathFigure
21.Set SweepDirection=Clockwise for ArcSegmentSet SweepDirection=Clockwise for ArcSegment
22.PathFigure and BezierSegmentPathFigure and BezierSegment
23.Path with BlurBitmapEffectPath with BlurBitmapEffect
24.Path with DropShadowBitmapEffectPath with DropShadowBitmapEffect
25.Path based on GeometryGroupPath based on GeometryGroup
26.Set for RenderTransformOrigin PathSet for RenderTransformOrigin Path
27.Use TransformGroup to group transformationsUse TransformGroup to group transformations
28.Transform PathTransform Path
29.Grouped ShapesGrouped Shapes
30.FileRule = Nonzero for PathFileRule = Nonzero for Path
31.FileRule = EvenOdd for PathFileRule = EvenOdd for Path
32.Path with EllipseGeometriesPath with EllipseGeometries
33.One Path with two EllipseGeometriesOne Path with two EllipseGeometries
34.Dotted PathDotted Path
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.