Load image from file using Bitmap class
- From: "Keven Corazza" <KevenCorazza@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 6 Jun 2005 04:28:04 -0700
Hi, I'm trying to load some images (png, bmp, jpeg) from file using Bitmap
class.
My code is very simple:
private void button1_Click(object sender, System.EventArgs e)
{
Bitmap img=null;
System.Windows.Forms.OpenFileDialog dlgOpen = new OpenFileDialog();
if (dlgOpen.ShowDialog()==DialogResult.OK)
{
img=new Bitmap(dlgOpen.FileName);
MessageBox.Show("Open!");
}
}
I made many test and I can load and work with small images (less than 300
Kb) while I get ArgumentException with medium size images.
The strange thing is that PictureBox component can load the images without
problem.
I made some mistake or there is some limits in Bitmap class ? I made also
some test in emulator and on real device: I've seen that real device can load
images than cannot be loaded in the emulator but again cannot load image over
a defined size.
It seems that somewhere there is a limit in the size.
Thank you in advance.
Regards
Keven Corazza
.
- Prev by Date: HTTP PUT returns '501 Not Implemented'
- Next by Date: Re: Playing sound
- Previous by thread: HTTP PUT returns '501 Not Implemented'
- Next by thread: Encoding question.
- Index(es):