public void Apply(DragBallNavigator dragball) { Translation.X += dragball.Pane.X / 2; Translation.Y += dragball.Pane.Y / 2; Scale /= dragball.Zoom; Rotation += dragball.Angle.X / 4; }
private void CorrectionMatrix_Load(object sender, EventArgs e) { try { if (File.Exists(QuickFileName)) { ProcessScanData(ScanDataIO.Read(QuickFileName)); } EnableLaser(true); } catch { EnableLaser(false); } Drag = new DragBallNavigator(PreviewPanel); Drag.Init(); this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.Selectable, true); typeof(Panel).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, PreviewPanel, new object[] { true }); PreviewPanel.TabStop = true; this.MouseWheel += Drag.MouseWheel; }