how to save a square image when the original image is rectangular?

0

I'm trying to store in a folder called Photos only square images but I can not do it, any ideas?

  private void btnFoto_Click(object sender, EventArgs e)
    {
        OpenFileDialog openFileDialog1 = new OpenFileDialog();
        openFileDialog1.Filter = "JPG(*.jpg)|*";
        openFileDialog1.FilterIndex = 4;
        openFileDialog1.RestoreDirectory = true;
        string dir = openFileDialog1.FileName;
        Bitmap picture = new Bitmap(dir);
        PictureBoxRound.Image = (Image)picture;

        File.Copy(dir, @"Fotos\" + 777 + ".jpg");   // aqui hago la copia y guarda del mismo tamaño

    string pathimagen = "";
    pathimagen = openFileDialog1.FileName;
}

    
asked by 29.03.2018 в 18:23
source

0 answers