TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
David Kay
NA
12
7k
Polygon Rotation Problem
Jul 11 2011 4:39 AM
I have a polygon, I rotate it 90 degrees, it shows up fine on the GUI, however the ActualHeight and ActualWidth are still the same as before. I have tried RenderTransform and LayoutTransform, but neither makes a difference.
How can I make it so the polygon's height and width get updated after the transform?
The following is in the constructor under InitializeComponent();
-------------------------------------------------
Polygon _currShape = new Polygon();
_currShape.Fill = System.Windows.Media.Brushes.Blue;
System.Windows.Media.PointCollection pointCollection = new System.Windows.Media.PointCollection();
pointCollection.Add(new Point(23, 0));
pointCollection.Add(new Point(115, 0));
pointCollection.Add(new Point(115, 23));
pointCollection.Add(new Point(23, 23));
_currShape.Points = pointCollection;
TetrisCanvas.Children.Add(_currShape);
Canvas.SetLeft(_currShape, 100);
Canvas.SetTop(_currShape, 100);
RotateTransform rt = new RotateTransform(90);
_currShape.RenderTransform = rt;
Reply
Answers (
9
)
WPF data binding
Object Type at Coordinate on Canvas