Ejemplo n.º 1
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            float minU, minV, maxU, maxV;

            minU = (float)p1.X / picTexture.Width;
            minV = (float)p1.Y / picTexture.Height;
            maxU = (float)p2.X / picTexture.Width;
            maxV = (float)p2.Y / picTexture.Height;

            refImage.Points[0].U = minU;
            refImage.Points[1].U = minU;
            refImage.Points[2].U = maxU;
            refImage.Points[3].U = maxU;

            refImage.Points[0].V = maxV;
            refImage.Points[1].V = minV;
            refImage.Points[2].V = maxV;
            refImage.Points[3].V = minV;

            if (chkScaleObject.Checked)
            {
                if (radScaleX.Checked)
                {
                    float scaleF = (maxU - minU) / (maxV - minV);
                    refImage.Scale(scaleF, 1.0f);
                }
                else
                {
                    float scaleF = (maxV - minV) / (maxU - minU);
                    refImage.Scale(1.0f, scaleF);
                }
            }

            this.Close();
        }
Ejemplo n.º 2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     refImage.Scale((float)numScaleFactorX.Value, (float)numScaleFactorY.Value);
     this.Close();
 }