private void DrawRollTick(double cycleR, double angle) { Line line = new Line(); line.X1 = 0; line.X2 = 0; line.Y1 = 8; line.Y2 = 0; line.Stroke = Brushes.White; line.StrokeThickness = 2; Canvas.SetTop(line, -cycleR); line.RenderTransform = new RotateTransform(angle, 0, cycleR); Canvas_ViewPortMiddle.Children.Add(line); var textblock = new BorderTextLabel(); textblock.Width = 14; textblock.Stroke = Brushes.DimGray; textblock.HorizontalContentAlignment = HorizontalAlignment.Center; textblock.Text = angle.ToString("##0"); textblock.Foreground = Brushes.White; textblock.FontSize = 10; textblock.FontWeight = FontWeights.Light; Canvas.SetTop(textblock, -cycleR + 10); Canvas.SetLeft(textblock, -textblock.Width / 2); textblock.RenderTransform = new RotateTransform(angle, textblock.Width / 2, cycleR - 10); Canvas_ViewPortMiddle.Children.Add(textblock); }
private void DrawPitchTick(double pitch, double offset) { Line line = new Line(); line.X1 = 0; line.X2 = 30; line.Y1 = 0; line.Y2 = 0; line.Stroke = Brushes.White; line.StrokeThickness = 2; Canvas.SetLeft(line, -15); Canvas.SetTop(line, offset); Canvas_ViewPortMiddle.Children.Add(line); var textblock_left = new BorderTextLabel(); var textblock_right = new BorderTextLabel(); textblock_left.Width = 14; textblock_left.Stroke = Brushes.DimGray; textblock_left.HorizontalContentAlignment = HorizontalAlignment.Center; if (pitch != 0) { textblock_left.Text = pitch.ToString("##0"); } textblock_left.Foreground = Brushes.White; textblock_left.FontSize = 10; textblock_left.FontWeight = FontWeights.Light; textblock_right.Width = 14; textblock_right.Stroke = Brushes.DimGray; textblock_right.HorizontalContentAlignment = HorizontalAlignment.Center; if (pitch != 0) { textblock_right.Text = pitch.ToString("##0"); } textblock_right.Foreground = Brushes.White; textblock_right.FontSize = 10; textblock_right.FontWeight = FontWeights.Light; Canvas.SetTop(textblock_left, offset - 6); Canvas.SetLeft(textblock_left, -textblock_left.Width - 22); Canvas_ViewPortMiddle.Children.Add(textblock_left); Canvas.SetTop(textblock_right, offset - 6); Canvas.SetLeft(textblock_right, 22); Canvas_ViewPortMiddle.Children.Add(textblock_right); }