Click here to Skip to main content
15,888,527 members
Articles / Programming Languages / C#

Text on A Path for Silverlight

Rate me:
Please Sign up or sign in to vote.
4.86/5 (8 votes)
27 Oct 2008CPOL3 min read 73.7K   1.3K   36  
Displays a text string along a path defined by a given geometry.
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MatrixMathHelpers
{
    public class RectHelper
    {
        Rect _value;
        public Rect Value
        {
            get { return _value; }
            set { _value = value; }
        }

        public RectHelper(Rect Input)
        {
            _value = Input;
        }

        public RectHelper()
        {
        }

        // Summary:
        //     Gets the position of the top-left corner of the rectangle.
        //
        // Returns:
        //     The position of the top-left corner of the rectangle.
        public Point TopLeft
        {
            get { return (new Point(_value.X, _value.Y)); }
        }
      
        //
        // Summary:
        //     Gets the position of the top-right corner of the rectangle.
        //
        // Returns:
        //     The position of the top-right corner of the rectangle.
        public Point TopRight
        {
            get { return (new Point(_value.X + _value.Width, _value.Y)); }
        }

        //
        // Summary:
        //     Gets the position of the bottom-left corner of the rectangle
        //
        // Returns:
        //     The position of the bottom-left corner of the rectangle.
        public Point BottomLeft
        {
            get { return (new Point(_value.X, _value.Y + _value.Height)); }
        }
   
        //
        // Summary:
        //     Gets the position of the bottom-right corner of the rectangle.
        //
        // Returns:
        //     The position of the bottom-right corner of the rectangle.
        public Point BottomRight
        {
            get { return (new Point(_value.X + _value.Width, _value.Y + _value.Height)); }
        }
   

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
I work in the Bay Area primarily developing software on the Windows platform using C++, .NET/C#, WPF, and Silverlight.

Comments and Discussions