private void UndoClick(object sender, RoutedEventArgs e) { if (Editor.Count > 0) { PreviewBitmap.Lock(); Editor.Route.Draw(PreviewBitmap, 0); Editor.Undo(); Editor.Route.Draw(PreviewBitmap, (255 << 24) | (255 << 16)); PreviewBitmap.Unlock(); } }
private void ImageRightClick(object sender, MouseButtonEventArgs e) { if (Editor.Count > 0) { PreviewBitmap.Lock(); Editor.Route.Draw(PreviewBitmap, 0); var position = e.GetPosition(PreviewImage); Editor.ReplaceLast(position.X, position.Y); Editor.Route.Draw(PreviewBitmap, (255 << 24) | (255 << 16)); PreviewBitmap.Unlock(); } }
private void ImageLeftClick(object sender, MouseButtonEventArgs e) { try { int altitude = int.Parse(AltitudeTextBox.Text); double velocity = double.Parse(VelocityTextBox.Text); PreviewBitmap.Lock(); Editor.Route.Draw(PreviewBitmap, 0); var position = e.GetPosition(PreviewImage); Editor.AddLast(position.X, position.Y, velocity, altitude); Editor.Route.Draw(PreviewBitmap, (255 << 24) | (255 << 16)); PreviewBitmap.Unlock(); } catch (FormatException) { MessageBox.Show($"Nieprawidłowy format wysokości lub prędkości.", "Błąd", MessageBoxButton.OK); } }