Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Bitmap.FromFile(filepath) - exception Out of memory

Bitmap.FromFile(filepath) - exception Out of memory

Scheduled Pinned Locked Moved Graphics
graphicsperformancehelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Krishnraj
    wrote on last edited by
    #1

    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

    B 1 Reply Last reply
    0
    • K 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

      B Offline
      B Offline
      Baltoro
      wrote on last edited by
      #2

      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."

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups