Bitmap.FromFile(filepath) - exception Out of memory
-
Hi all, i make one application in which i read the image file of type *.lbl using Bitmap.FromFile(filepath) at that time it will give me an error of "Out of memory". I know Bitmap supports only BMP ,GIF,JPEG ,PNG ,TIFF. So can any one suggest me what should i do read my own extension (*.lbl) file using Bitmap or any other methode ???? Thanks in advance..
Rana Krishnraj
-
Hi all, i make one application in which i read the image file of type *.lbl using Bitmap.FromFile(filepath) at that time it will give me an error of "Out of memory". I know Bitmap supports only BMP ,GIF,JPEG ,PNG ,TIFF. So can any one suggest me what should i do read my own extension (*.lbl) file using Bitmap or any other methode ???? Thanks in advance..
Rana Krishnraj
Rana Krishnraj, Well, using the NET Framework class is clearly not going to work because it expects to see a specific, known data format. If you have your own image file format, (and, of course, we don't know anything about it), you could: (1) Convert it to a convenient format that your NET Framework bitmap class instance will recognize. I would suggest reading up on the native Win32 Bitmap[^] data structure, and create a valid bitmap (actually, a , DIB, Device Independent Bitmap[^]) in memory. (2) Write a custom file reader that adequately processes your custom file format. If you don't know anything about the Bitmap data structure, you should read: Bitmap Storage MSDN[^], or, Storing an Image MSDN[^] As Feng Yuan says: "The good thing about a DIB is that its storage is managed by the application, so the application can directly access its color table and pixel array, but GDI would not lend a hand to you in setting up a DIB."