I am trying to get image from FileDialog My code :
private void BtnAddImage_Click(object sender, EventArgs e)
{
OpenFileDialog addImage = new OpenFileDialog();
if (addImage.ShowDialog() == DialogResult.OK)
{
PbAddImage.Image = new Bitmap(addImage.FileName);
}
PbAddImage.Image.Save("C:\\Users\\musa\\Documents\\Hobby\\testUser.jpg");
}
When i select images which height is bigger than width. (For example, width 1200 px , height 1600 px). In pictureBox i saw this image left rotated.But if image width is bigger than height , there is no problem.
And then i saved this image to file, in saved image there is no problem. It does not save as rotated.
How can i handle this issue ? Why images shows rotated ?
Edit : Here is my PbAddImage properties :
this.PbAddImage.Location = new System.Drawing.Point(157, 211); this.PbAddImage.Name = "PbAddImage"; this.PbAddImage.Size = new System.Drawing.Size(112, 161); this.PbAddImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.PbAddImage.TabIndex = 138; this.PbAddImage.TabStop = false;