Example #1
0
        private void Btn_loadPic_Click(object sender, EventArgs e)
        {
            OpenFileDialog op = new OpenFileDialog();

            if (op.ShowDialog() == DialogResult.OK)
            {
                var fileName = op.FileName;
                //Image<Bgr, Byte> img = new Image<Bgr, byte>(op.FileName);
                var image = Image.FromFile(op.FileName);
                //this.movePictureBox.LoadImage(image);
                PictureHelper.ResizePictureBoxSizeByBitmap(this.picBox, image.Width, image.Height);

                PictureHelper.FillPictureBoxSizeToPanel(this.picBox, this.panelImage);

                //计算中间点重合
                this.panelCenterPoint = CaculatePanelCenterPoint(this.panelImage);
                SetPicBoxCenterInOnePoint(this.picBox, this.panelCenterPoint, this.picBoxCenterPointOffset);


                this.picBox.Image = image;
            }
        }
Example #2
0
 private void Btn_rotate_Click(object sender, EventArgs e)
 {
     PictureHelper.RotatePictureFormCenter(this.picBox, (float)this.num_angle.Value);
 }
Example #3
0
 private void Btn_rotate_Click(object sender, EventArgs e)
 {
     PictureHelper.RotatePictureFormCenter(this.ib_original, 90);
 }