Out of memory exception while loadin a tiff image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alwayssmiling
    New Member
    • Oct 2006
    • 33

    Out of memory exception while loadin a tiff image

    Hi,

    Im loading a tif image of size more than 4MB, into the picture box. With the help of following code snippet.

    FileStream fs = File.OpenRead(i magePath);

    Image img = Image.FromStrea m(fs);

    But while executing the statement Image.fromstrea m(), Im getting the exception System.Outof memory exception. Any suggestion for this problem........ ..
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    What is the amount of RAM and Virtual memory u have ?

    Debug the application and Check ur memory, system resource consumption by using Task Manager.

    :)

    Comment

    • alwayssmiling
      New Member
      • Oct 2006
      • 33

      #3
      Hi,

      My systems Ram Size is 512MB virtual memory size is 700MB. Then wat may be the prob for this exception to occur..........

      Comment

      • radcaesar
        Recognized Expert Contributor
        • Sep 2006
        • 759

        #4
        Check the occupied memory after or during the file upload.

        I don't wanna the original configuration of the system. Debug and check the resource.

        :)

        Comment

        • alwayssmiling
          New Member
          • Oct 2006
          • 33

          #5
          ya,

          while debugging also its not behaving improperly. There is no sudden increase in memory requirement. Its working fine up to getting the stream format of the image from the file,

          filestream fs = File.OpenRead(i magepath);

          but while getting the actual image from the stream its generating the actual problem.

          Image img = Image.FromStrea m(fs);

          Thank u for ur reply.......... .

          Comment

          • Poojakale
            New Member
            • May 2007
            • 1

            #6
            Hi,

            Just do save as jpg once again for the same image and then load this image in the control.

            Comment

            Working...