Click here to Skip to main content
15,881,715 members
Articles / Desktop Programming / WPF

PolyStar - WPF Polygons and Stars

Rate me:
Please Sign up or sign in to vote.
4.88/5 (32 votes)
27 Sep 2008CPOL4 min read 82.1K   2K   44  
Control and tool for the creation of various stars and polygons.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using PointTransformations;
namespace PolygonImageLib
{
internal    class OverallTransformation
    {
    private bool mIsRotated;
    private bool mIsAspected;
        private double mRotation;
        private double mAspect;
        public Double Rotation
        {
            get { return mRotation; }
            set { mRotation = value;

            }
        }

        public bool IsRotated
        {

            get { return  mIsRotated; }
            set
            {
                mIsRotated = value;
          
                 }

        }

     public bool IsAspected
        {
            get { return mIsAspected; }
            set
            {
                mIsAspected = value;

           
            
            }
        }

        public double Aspect
        {
            get { return mAspect; }
            set { mAspect = value;
          
            }

        }

        public void Transform(Matrix mat)
        {

            PointTransformations.RotationalTransformation rot = new PointTransformations.RotationalTransformation();
            rot.Matrix = mat;
            rot.RotateDegreesAroundOrigin(mRotation);

            LinearTransformation lt = new LinearTransformation();
            lt.Matrix = mat;
            if (mAspect < 0)
            {
                lt.StretchX =1 + mAspect ;
                lt.Transform();
            }
            if (mAspect > 0)
            {
                lt.StretchY = 1 -  + mAspect;
                lt.Transform();
            }

        }

      



 
    }
}

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
Written software for what seems like forever. I'm currenly infatuated with WPF. Hopefully my affections are returned.

Comments and Discussions