# C# Bitmap Size Issues?

This topic is 3924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm loading in Bitmaps into C# and displaying them on a form. I'm just using the following:
Bitmap bmp = new Bitmap(ofn.FileName);
this.Width = bmp.Size.Width;
this.Height = bmp.Size.Height;

...

private void TB_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
if (bmp == null)
return;
Graphics g = e.Graphics;
g.DrawImage(bmp, 0, 0);
}

I've noticed, however, that when the images are displayed on the form, that they appear to be stretched, usually in the same aspect ratio. I know this by comparing them with the same images in Photoshop and the fact that the code to resize the window, doesn't fully expand to show the whole image (even considering the title bar). Any idea why this might be or how I can fix it?

1. 1
2. 2
3. 3
4. 4
Rutin
18
5. 5

• 11
• 22
• 12
• 12
• 11
• ### Forum Statistics

• Total Topics
631406
• Total Posts
2999905
×