J
Jon Slaughter
I am trying to load an image using From image. All the code work(even a
simple test version such as
Bitmap bitmap;
public Form1()
{
InitializeComponent();
bitmap = (Bitmap)Bitmap.FromFile(@"C:\Documents and Settings\Jon\My
Documents\Visual Studio 2005\Projects\BMTest1\BMTest1\Earth.png");
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawImage(bitmap, 0, 0);
e.Graphics.DrawRectangle(Pens.AliceBlue, 0, 0, bitmap.Width, bitmap.Height);
}
}
except for the fact that the image is much smaller than it should be. If I
put the same image in a paint box then it is full size. The rectangle has
over 3 times the size of the bitmap shown by draw image.
Basically my image is 300x300 but the DrawImage function is showing an image
with the size of about 95x95. Of course it has something to do with the
FromFile call I believe and not the Draw Image.
Any one know whats going on? I believe that it might have to do with reading
a thumbnail instead of the actual file as I recall reading someone else
having a similar problem a while back.
Thanks,
Jon
simple test version such as
Bitmap bitmap;
public Form1()
{
InitializeComponent();
bitmap = (Bitmap)Bitmap.FromFile(@"C:\Documents and Settings\Jon\My
Documents\Visual Studio 2005\Projects\BMTest1\BMTest1\Earth.png");
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawImage(bitmap, 0, 0);
e.Graphics.DrawRectangle(Pens.AliceBlue, 0, 0, bitmap.Width, bitmap.Height);
}
}
except for the fact that the image is much smaller than it should be. If I
put the same image in a paint box then it is full size. The rectangle has
over 3 times the size of the bitmap shown by draw image.
Basically my image is 300x300 but the DrawImage function is showing an image
with the size of about 95x95. Of course it has something to do with the
FromFile call I believe and not the Draw Image.
Any one know whats going on? I believe that it might have to do with reading
a thumbnail instead of the actual file as I recall reading someone else
having a similar problem a while back.
Thanks,
Jon