I needed to get the executable path and save it to a folder inside the root directory where ".exe" is located, serving both the programming of the file in the "bin" and "debug" folder and the time to create the installer with the "inno setup" and open in any folder designated by the user at the time of installing the file. It is taking the name of the file and saving it in the format "bmp" but the catch and save part is not working in the directory of the executable see my code below
string pastaimagem = "imagem";
string appPath = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
Bitmap bmp = new Bitmap(openFileDialog1.FileName);
Bitmap bmp2 = new Bitmap(bmp, pictureBox2.Size);
pictureBox2.Image = bmp2;
string pasta = appPath + pastaimagem;
if (!Directory.Exists(pasta))
{
Directory.CreateDirectory(pasta);
}
pictureBox2.Image.Save(pasta + txtCod.Text + ".bmp", System.Drawing.Imaging.ImageFormat.Bmp);