Esempio n. 1
0
        private void Populate()
        {
            DistortionParameters p = distorter.Parameters;

            lblK1.Text = string.Format("k1 : {0:0.000}", p.K1);
            lblK2.Text = string.Format("k2 : {0:0.000}", p.K2);
            lblK3.Text = string.Format("k3 : {0:0.000}", p.K3);
            lblP1.Text = string.Format("p1 : {0:0.000}", p.P1);
            lblP2.Text = string.Format("p2 : {0:0.000}", p.P2);

            lblFx.Text = string.Format("fx : {0:0.000}", p.Fx);
            lblFy.Text = string.Format("fy : {0:0.000}", p.Fy);
            lblCx.Text = string.Format("cx : {0:0.000}", p.Cx);
            lblCy.Text = string.Format("cy : {0:0.000}", p.Cy);

            Color  background        = Color.FromArgb(255, 42, 42, 42);
            Color  foreground        = Color.White;
            int    steps             = 20;
            Bitmap bmpDistortionGrid = distorter.GetDistortionGrid(background, foreground, steps);

            RatioStretch(bmpDistortionGrid, pbDistortion);

            bmpUndistorted = distorter.GetUndistortedImage(currentImage);

            UpdateImages();
        }
 private void UpdateDistortionGrid()
 {
     // Update the grid bitmap and the preview.
     bmpGrid = distorter.GetDistortionGrid(styleHelper.Color, styleHelper.LineSize, styleHelper.GridDivisions);
     pnlPreview.Invalidate();
 }