EMGU - Image的畫面縮放 - 延伸應用 1. 讀圖片時 將圖片設定成 ImageBox 的大小

讀檔案→設定Image大小→放到 ImageBox 裡面

讀檔案→設定Image大小→放到 ImageBox 裡面

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog filename = new OpenFileDialog();
            if (filename.ShowDialog() == DialogResult.OK)
            {
                textBox1.Text = filename.FileName;
                Image<Gray, byte> LoadImage = new Image<Gray, byte>(filename.FileName);

                Image<Gray, byte> OutImage = LoadImage.Resize(
                         (int)( (imageBox1.Size.Width)),
                         (int)( (imageBox1.Size.Height)), Inter.Linear);


                imageBox1.Image = OutImage;
                imageBox1.FunctionalMode = ImageBox.FunctionalModeOption.Minimum;
            }
        }