Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.dockPanelRoot.DataContext = imageViewModel;

            horizontalPositionConverter = (ImagePositionConverter)this.Resources["HorizontalPositionConverter"];
            horizontalPositionConverter.GetMaxImagePosition = new Func <int>(
                () => { return(this.imageViewModel.LoadedBitmapWidth); }
                );
            horizontalPositionConverter.GetMaxViewPosition = new Func <double>(
                () => { return(this.imageMain.ActualWidth); }
                );


            verticalPositionConverter = (ImagePositionConverter)this.Resources["VerticalPositionConverter"];
            verticalPositionConverter.GetMaxImagePosition = new Func <int>(
                () => { return(this.imageViewModel.LoadedBitmapHeight); }
                );
            verticalPositionConverter.GetMaxViewPosition = new Func <double>(
                () => { return(this.imageMain.ActualHeight); }
                );


            this.imageViewModel.LoadedBitmap = (BitmapImage)this.Resources["KiritoriMageHelp"];

            ImageAdorner imageAdorner = new ImageAdorner(this.imagePanel)
            {
                ImageViewModel = this.imageViewModel,
                HorizontalPositionConverter = horizontalPositionConverter,
                VerticalPositionConverter   = verticalPositionConverter
            };

            imageAdornerLayer = AdornerLayer.GetAdornerLayer(this.imagePanel);
            imageAdornerLayer.Add(imageAdorner);

            // mainly for generating a new point
            imageViewModel.RangeDataUpdated += new EventHandler((sender1, e1) => {
                imageAdornerLayer.Update();
            });

            this.Width  = Properties.Settings.Default.WindowWidth;
            this.Height = Properties.Settings.Default.WindowHeight;
        }
Exemplo n.º 2
0
 private void thumbDragDelta(SplitPositionItem item, ImagePositionConverter converter, double change)
 {
     item.Position += converter.ConvertViewPositionToImagePosition(change);
 }
Exemplo n.º 3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.dockPanelRoot.DataContext = imageViewModel;

            horizontalPositionConverter = (ImagePositionConverter)this.Resources["HorizontalPositionConverter"];
            horizontalPositionConverter.GetMaxImagePosition = new Func<int>(
                () => { return this.imageViewModel.LoadedBitmapWidth; }
            );
            horizontalPositionConverter.GetMaxViewPosition = new Func<double>(
                () => { return this.imageMain.ActualWidth; }
            );

            verticalPositionConverter = (ImagePositionConverter)this.Resources["VerticalPositionConverter"];
            verticalPositionConverter.GetMaxImagePosition = new Func<int>(
                () => { return this.imageViewModel.LoadedBitmapHeight; }
            );
            verticalPositionConverter.GetMaxViewPosition = new Func<double>(
                () => { return this.imageMain.ActualHeight; }
            );

            this.imageViewModel.LoadedBitmap = (BitmapImage)this.Resources["KiritoriMageHelp"];

            ImageAdorner imageAdorner = new ImageAdorner(this.imagePanel)
            {
                ImageViewModel = this.imageViewModel,
                HorizontalPositionConverter = horizontalPositionConverter,
                VerticalPositionConverter = verticalPositionConverter
            };

            imageAdornerLayer = AdornerLayer.GetAdornerLayer(this.imagePanel);
            imageAdornerLayer.Add(imageAdorner);

            // mainly for generating a new point
            imageViewModel.RangeDataUpdated += new EventHandler((sender1, e1) => {
                imageAdornerLayer.Update();
            });

            this.Width = Properties.Settings.Default.WindowWidth;
            this.Height = Properties.Settings.Default.WindowHeight;
        }
Exemplo n.º 4
0
 private void thumbDragDelta(SplitPositionItem item, ImagePositionConverter converter, double change)
 {
     item.Position += converter.ConvertViewPositionToImagePosition(change);
 }