Пример #1
0
 private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (IsLoaded)
     {
         IsLoaded = false;
         Picture  = MandelbrotService.GenerateBitmapSource(MandelbrotService.Calculate(Args), Args);
         IsLoaded = true;
     }
 }
Пример #2
0
 private void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     Args = new MandelBrotArgs {
         ZoomBase   = 2,
         ZoomFactor = 7,
         Iterations = 255,
         Size       = new Size(512, 512)
     };
     Picture  = MandelbrotService.GenerateBitmapSource(MandelbrotService.Calculate(Args), Args);
     IsLoaded = true;
 }
Пример #3
0
        private void Image_MouseWheel(object sender, MouseWheelEventArgs e)
        {
            var pos = e.GetPosition((IInputElement)sender);

            MouseX = Args.Center.X + (((decimal)pos.X - (Args.Size.Width / 2)) * Args.RealZoom);
            MouseY = Args.Center.Y - (((decimal)pos.Y - (Args.Size.Height / 2)) * Args.RealZoom);

            if (IsLoaded)
            {
                IsLoaded      = false;
                Args.Center.X = MouseX;
                Args.Center.Y = MouseY;
                if (e.Delta > 0)
                {
                    Args.ZoomFactor++;
                }
                else
                {
                    Args.ZoomFactor--;
                }
                Picture  = MandelbrotService.GenerateBitmapSource(MandelbrotService.Calculate(Args), Args);
                IsLoaded = true;
            }
        }
Пример #4
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     MandelbrotService.GenerateDiashow(Args, PictureCount);
 }