Example #1
0
        private void ImageFlip(FlipDirection direction)
        {
            ImageSizing imageSize = new ImageSizing(tifEditor.Viewer);
            int         degree    = (direction == FlipDirection.Left) ? -1:1;

            imageSize.RotateImageAndAnnotations(degree * 90, tifEditor.AnnAutomation.Container);
        }
Example #2
0
        private void ImageZoom(ZoomSize zoomSize)
        {
            ImageSizing imageSize = new ImageSizing(tifEditor.Viewer);

            imageSize.Zoom(zoomSize);
            tifEditor.ScaleFactor = imageSize.getScaleFactor();
        }
Example #3
0
        /// <summary>
        /// Loads the images in view mode.
        /// </summary>
        public void LoadImage()
        {
            try
            {
                ImageLoader imgLoader = new ImageLoader();

                imgLoader.FileName = newFileName;
                imgLoader.Load(_codec);
                RasterImage _image = imgLoader.Image;
                this.imageViewer.Image = null;
                imageFileName          = newFileName;
                if (_image != null)
                {
                    this.imageViewer.Image = _image;
                    ImageSizing sizing = new ImageSizing(imageViewer);
                    sizing.SetScale(scaleFactor);
                    _codec.Options.Load.XResolution             = imageViewer.Image.XResolution;
                    _codec.Options.Load.YResolution             = imageViewer.Image.YResolution;
                    _annAutomation.Container.UnitConverter.DpiX = imageViewer.Image.XResolution;
                    _annAutomation.Container.UnitConverter.DpiY = imageViewer.Image.YResolution;

                    if (imageViewer.Image.XResolution == 204 && imageViewer.Image.YResolution == 196)
                    {
                        imageViewer.UseDpi = true;
                    }
                    else
                    {
                        imageViewer.UseDpi = false;
                    }

                    annotation.LoadFromFile(imageFileName);
                    annotation.LoadFromMemory(1);
                    imageToolBar.setFileName(newFileName);
                }

                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty   = false;

                imageToolBar.UpdateToolBar();

                saveAsFileName = null; // always user has to set it.
//                this.Edit = false;
            }
            catch (Exception e)
            {
                imageViewer.Image           = null;
                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty   = false;
                imageToolBar.UpdateToolBar();
                XtraMessageBox.Show("An error occurred while loading the image for file: " + newFileName + "." + Environment.NewLine +
                                    "Error CNF-391 in " + FORM_NAME + ".LoadImage(): " + e.Message,
                                    FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #4
0
        public void LoadImage(Stream stream)
        {
            try
            {
                ImageLoader imgLoader = new ImageLoader();
                imgLoader.Stream = stream;
                imgLoader.Load(_codec);
                RasterImage _image = imgLoader.Image;
                imageViewer.Image = null;
                if (_image != null)
                {
                    imageViewer.Image = _image;
                    ImageSizing sizing = new ImageSizing(imageViewer);
                    sizing.SetScale(scaleFactor);
                    _codec.Options.Load.XResolution             = imageViewer.Image.XResolution;
                    _codec.Options.Load.YResolution             = imageViewer.Image.YResolution;
                    _annAutomation.Container.UnitConverter.DpiX = imageViewer.Image.XResolution;
                    _annAutomation.Container.UnitConverter.DpiY = imageViewer.Image.YResolution;

                    if (imageViewer.Image.XResolution == 204 && imageViewer.Image.YResolution == 196)
                    {
                        imageViewer.UseDpi = true;
                    }
                    else
                    {
                        imageViewer.UseDpi = false;
                    }

                    annotation.LoadFromStream(stream);
                    annotation.LoadFromMemory(1);
                }

                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty   = false;

                imageToolBar.UpdateToolBar();

                saveAsFileName = null; // always user has to set it.
                Edit           = false;
            }
            catch (Exception ex)
            {
                imageViewer.Image           = null;
                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty   = false;
                imageToolBar.UpdateToolBar();
                throw new Exception("An error occurred while loading the image." + Environment.NewLine +
                                    "Error CNF-392 in " + FORM_NAME + ".LoadImage(): " + ex.Message);
            }
        }
Example #5
0
        public void LoadImage(Stream stream)
        {
            try
            {                
                ImageLoader imgLoader = new ImageLoader();
                imgLoader.Stream = stream;
                imgLoader.Load(_codec);
                RasterImage _image = imgLoader.Image;
                imageViewer.Image = null;
                if (_image != null)
                {
                    imageViewer.Image = _image;
                    ImageSizing sizing = new ImageSizing(imageViewer);
                    sizing.SetScale(scaleFactor);
                    _codec.Options.Load.XResolution = imageViewer.Image.XResolution;
                    _codec.Options.Load.YResolution = imageViewer.Image.YResolution;
                    _annAutomation.Container.UnitConverter.DpiX = imageViewer.Image.XResolution;
                    _annAutomation.Container.UnitConverter.DpiY = imageViewer.Image.YResolution;

                    if (imageViewer.Image.XResolution == 204 && imageViewer.Image.YResolution == 196)
                    {
                        imageViewer.UseDpi = true;
                    }
                    else
                    {
                        imageViewer.UseDpi = false;
                    }

                    annotation.LoadFromStream(stream);
                    annotation.LoadFromMemory(1);
                }

                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty = false;

                imageToolBar.UpdateToolBar();

                saveAsFileName = null; // always user has to set it.
                Edit = false;
            }
            catch (Exception ex)
            {
                imageViewer.Image = null;
                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty = false;
                imageToolBar.UpdateToolBar();
                throw new Exception("An error occurred while loading the image." + Environment.NewLine +
                     "Error CNF-392 in " + FORM_NAME + ".LoadImage(): " + ex.Message);
            }
        }
Example #6
0
        /// <summary>
        /// Loads the images in view mode.
        /// </summary>
        public void LoadImage()
        {
            try
            {               
                ImageLoader imgLoader = new ImageLoader();

                imgLoader.FileName = newFileName;
                imgLoader.Load(_codec);
                RasterImage _image = imgLoader.Image;
                this.imageViewer.Image = null;
                imageFileName = newFileName;
                if (_image != null)
                {
                    this.imageViewer.Image = _image;
                    ImageSizing sizing = new ImageSizing(imageViewer);
                    sizing.SetScale(scaleFactor);
                    _codec.Options.Load.XResolution = imageViewer.Image.XResolution;
                    _codec.Options.Load.YResolution = imageViewer.Image.YResolution;
                    _annAutomation.Container.UnitConverter.DpiX = imageViewer.Image.XResolution;
                    _annAutomation.Container.UnitConverter.DpiY = imageViewer.Image.YResolution;
                    
                    if (imageViewer.Image.XResolution == 204 && imageViewer.Image.YResolution == 196)
                    {
                        imageViewer.UseDpi = true;
                    }
                    else
                    {
                        imageViewer.UseDpi = false;
                    }
                    
                    annotation.LoadFromFile(imageFileName);
                    annotation.LoadFromMemory(1);
                    imageToolBar.setFileName(newFileName);
                }

                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty = false;

                imageToolBar.UpdateToolBar();
                
                saveAsFileName = null; // always user has to set it.
//                this.Edit = false;
            }
            catch (Exception e)
            {
                imageViewer.Image = null;
                _annAutomation.ObjectsDirty = false;
                _annAutomation.ImageDirty = false;
                imageToolBar.UpdateToolBar();
                XtraMessageBox.Show("An error occurred while loading the image for file: " + newFileName  + "." + Environment.NewLine +
                        "Error CNF-391 in " + FORM_NAME + ".LoadImage(): " + e.Message,
                     FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #7
0
         private void ImageFlip(FlipDirection direction)
         {
             ImageSizing imageSize = new ImageSizing(tifEditor.Viewer);
             int degree = (direction == FlipDirection.Left) ? -1:1;

             imageSize.RotateImageAndAnnotations(degree * 90, tifEditor.AnnAutomation.Container);

         }
Example #8
0
         private void ImageZoom(ZoomSize zoomSize)
         {

             ImageSizing imageSize = new ImageSizing(tifEditor.Viewer);
             imageSize.Zoom(zoomSize);
             tifEditor.ScaleFactor = imageSize.getScaleFactor();
             
         }