コード例 #1
0
ファイル: ImageEditor.cs プロジェクト: PalakDave/Pices
        } /* ResizeWindow */

        private void  RePaintImage()
        {
            if ((sizeRatio <= 0.0f) || (image == null))
            {
                return;
            }

            byte[][] processedRaster = PerformAllOperations(raster);


            Bitmap newImage = BuildBitmapFromRasterData(processedRaster);

            int newWidth  = (int)((float)width * sizeRatio + 0.5f);
            int newHeight = (int)((float)height * sizeRatio + 0.5f);

            image = new Bitmap(newWidth, newHeight);
            Graphics imageDC = Graphics.FromImage(image);

            imageDC.Clear(backGroundColor);
            imageDC.ScaleTransform(sizeRatio, sizeRatio);
            imageDC.DrawImageUnscaled(newImage, 0, 0);

            newImage.Dispose();
            newImage = null;

            pictureBox1.Height = newHeight;
            pictureBox1.Width  = newWidth;
            pictureBox1.Image  = image;

            ImagePanel.AutoScroll        = true;
            ImagePanel.AutoScrollMinSize = image.Size;
            ImagePanel.Invalidate();
        } /* RePaintImage */
コード例 #2
0
ファイル: ImageEditor.cs プロジェクト: PalakDave/Pices
        public ImageEditor(PicesRaster _raster)
        {
            InitializeComponent();

            //raster         = (byte[][])_raster.BuildRasterArray ();
            raster        = _raster.BuildRasterArray2();
            imageFileName = _raster.FileName;

            instrumentData = null;
            height         = _raster.Height;
            width          = _raster.Width;

            _raster = null;

            BuildColorValues();

            SizeOptions.SelectedOption = "100%";

            image = BuildBitmapFromRasterData(raster);

            pictureBox1.Height = image.Height;
            pictureBox1.Width  = image.Width;
            pictureBox1.Image  = image;

            ImagePanel.AutoScroll = true;
            //ImagePanel.SetStyle   (ControlStyles.ResizeRedraw, false);
            ImagePanel.AutoScroll        = true;
            ImagePanel.AutoScrollMinSize = image.Size;
            ImagePanel.Invalidate();

            MakePredictions();
        }
コード例 #3
0
ファイル: ImageEditor.cs プロジェクト: PalakDave/Pices
        public ImageEditor(string _fileName,
                           int _height,
                           int _width,
                           byte[][]        _raster,// Will take ownership of '_raster'
                           InstrumentData _instrumentData
                           )
        {
            InitializeComponent();

            fileName       = _fileName;
            instrumentData = _instrumentData;
            raster         = _raster;
            height         = _height;
            width          = _width;

            imageFileName = _fileName;;

            BuildColorValues();

            SizeOptions.SelectedOption = "100%";

            image = BuildBitmapFromRasterData(raster);

            pictureBox1.Height = image.Height;
            pictureBox1.Width  = image.Width;
            pictureBox1.Image  = image;

            ImagePanel.AutoScroll = true;
            //ImagePanel.SetStyle   (ControlStyles.ResizeRedraw, false);
            ImagePanel.AutoScroll        = true;
            ImagePanel.AutoScrollMinSize = image.Size;
            ImagePanel.Invalidate();

            MakePredictions();
        }
コード例 #4
0
ファイル: ImageEditor.cs プロジェクト: PalakDave/Pices
        public ImageEditor(String _fileName)
        {
            InitializeComponent();

            imageFileName = _fileName;

            PicesRaster pr = null;

            try
            {
                pr = new PicesRaster(_fileName);
            }
            catch (Exception e)
            {
                pr = null;
                throw new Exception("ImageEditor", e);
            }

            raster         = pr.BuildRasterArray2();
            fileName       = _fileName;
            instrumentData = null;
            height         = pr.Height;
            width          = pr.Width;

            pr = null;

            BuildColorValues();

            SizeOptions.SelectedOption = "100%";

            image = BuildBitmapFromRasterData(raster);

            pictureBox1.Height = image.Height;
            pictureBox1.Width  = image.Width;
            pictureBox1.Image  = image;

            ImagePanel.AutoScroll = true;
            //ImagePanel.SetStyle   (ControlStyles.ResizeRedraw, false);
            ImagePanel.AutoScroll        = true;
            ImagePanel.AutoScrollMinSize = image.Size;
            ImagePanel.Invalidate();

            MakePredictions();
        }
コード例 #5
0
 // Redraw image panel
 private void RefreshTimer_Tick(object sender, EventArgs e)
 {
     ImagePanel.Invalidate();
 }