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
Sunny
NA
2
2.8k
rotate touch based needles of windows 8 clock app
May 15 2013 9:21 AM
I have mine windows 8 analog clock app that perform Touchable task to move minutes and hour angle by single touch ,but it could not work properly. it seems to be did not find angle correctly . I had worked on Manupulation delta events of clock needle ( i.e Line ) . When i moved needles forward than 1st time it goes some points backward. i dnt know how this is happning. How can i solve this issue. Please anyone can let me know.
Xaml code is :-
<Line Name="Hours" PointerEntered="ShowHand" PointerExited="ShowArrow" HorizontalAlignment="Center" VerticalAlignment="Center" X1="0" Y1="0" X2="0" Y2="-70" Stroke="Wheat" Margin="1,0,0,0" StrokeThickness="3" Grid.RowSpan="8" ManipulationDelta=" HourRight_ManipulationDelta" ManipulationMode="TranslateInertia,TranslateX,TranslateY">
<Line.RenderTransform>
<RotateTransform x:Name="HoursTransform" CenterX="0" CenterY="0" Angle="{Binding HourHandAngle}" />
</Line.RenderTransform>
</Line>
.cs Code is:-
private void HourRight_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
var x = HoursTransform.CenterX - e.Position.X;
var y = HoursTransform.CenterY - e.Position.Y;
var angle = Math.Atan(y / x);
var deltaAngle = Math.Atan((e.Delta.Translation.Y - y) / (x - e.Delta.Translation.X));
this.HoursTransform.Angle += angle - deltaAngle;
}
Reply
Answers (
0
)
How to rotate touch based needles ( Hour and Minute ) of win
How to fetch data from excel sheet in windows 8 app