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. C / C++ / MFC
  4. is there size limit to display an image with GDI+?

is there size limit to display an image with GDI+?

Scheduled Pinned Locked Moved C / C++ / MFC
questionwinformsgraphics
5 Posts 3 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
    King Tran
    wrote on last edited by
    #1

    whith the GDI+ method DrawImage(), i can display a normal size image, but i can't display an image with 400M size. is there size limit and how can i display a big size image? thanks.

    B T 2 Replies Last reply
    0
    • K King Tran

      whith the GDI+ method DrawImage(), i can display a normal size image, but i can't display an image with 400M size. is there size limit and how can i display a big size image? thanks.

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

      Where did you get an image of that magnitude? I can't say I've ever tried to display one that large. Some suggestions would be to not use interpolation to see if it renders. If your using something like InterpolationModeHighQualityBicubic you might be asking too much of the graphics object. Did you try rendering a much smaller image using the same code to see if it's displaying it in a part of your coordinate system that is visible. You might be rendering it in negative coordinates or somewhere off the client area. Does the large image display with other rendering programs like MS Photoeditor or something similar that will scale it to fit the screen? Try to eliminate those possibilities first if you haven't already.

      B 1 Reply Last reply
      0
      • B bob16972

        Where did you get an image of that magnitude? I can't say I've ever tried to display one that large. Some suggestions would be to not use interpolation to see if it renders. If your using something like InterpolationModeHighQualityBicubic you might be asking too much of the graphics object. Did you try rendering a much smaller image using the same code to see if it's displaying it in a part of your coordinate system that is visible. You might be rendering it in negative coordinates or somewhere off the client area. Does the large image display with other rendering programs like MS Photoeditor or something similar that will scale it to fit the screen? Try to eliminate those possibilities first if you haven't already.

        B Offline
        B Offline
        bob16972
        wrote on last edited by
        #3

        Another thing I forgot to add is to ask if the image isn't rendering but the app is responsive, or does it seem locked up and not responding? The reason for my question is that I've noticed for compression/decompression using a well known library like zlib, if the file image is excessively large, the decompression routine can take a very long time to finish. If the file format uses advanced compression schemes, the code probably will perform, performance-wise, similar to zlib since it's probably about as efficient as they come (within reason).;) If it seems to hang, it might not be done decompressing yet. I found myself blaming MSXML for taking a long time to load/save very large xml files only to realize that it was the decompression/compression stages I had inserted between the DOM parser and the file that were taking so long. Even changing the cache sizes had minimal effect on the time required for processing so I'm guessing it's inherent in what the compression algorithm does that starts to bog down with excessively large files. Just an idea.

        1 Reply Last reply
        0
        • K King Tran

          whith the GDI+ method DrawImage(), i can display a normal size image, but i can't display an image with 400M size. is there size limit and how can i display a big size image? thanks.

          T Offline
          T Offline
          Teashirt2
          wrote on last edited by
          #4

          well is this a higher res image(may be for print purposes) or just plain old large (like maps). Here are some ideas depending on the anser: 1. if the image is high res image such as 1200, 2400 dpi letter size rgb image, downsample the image first . Because, displaying that image (fitting the screen) full res is asking the graphics subsystem to downsample it on the fly. Image quality will not suffer (assuming you downsample it right). Do not over do it allowing the viewer zoom in say up to 300%. So even down to 300dpi will bring file size down to 1/16 allowing your self zoom in roughly about 300% without quality problems. 2. if the image is lower res (300 dpi or less), but large. most likely scenario you will not display it fitting the screen. Because it will look horrible, even if displaying was possible. In that case extract a region and display only that depending on the scroll position. I hope this gives you some ideas.

          K 1 Reply Last reply
          0
          • T Teashirt2

            well is this a higher res image(may be for print purposes) or just plain old large (like maps). Here are some ideas depending on the anser: 1. if the image is high res image such as 1200, 2400 dpi letter size rgb image, downsample the image first . Because, displaying that image (fitting the screen) full res is asking the graphics subsystem to downsample it on the fly. Image quality will not suffer (assuming you downsample it right). Do not over do it allowing the viewer zoom in say up to 300%. So even down to 300dpi will bring file size down to 1/16 allowing your self zoom in roughly about 300% without quality problems. 2. if the image is lower res (300 dpi or less), but large. most likely scenario you will not display it fitting the screen. Because it will look horrible, even if displaying was possible. In that case extract a region and display only that depending on the scroll position. I hope this gives you some ideas.

            K Offline
            K Offline
            King Tran
            wrote on last edited by
            #5

            thanks Teashirt2. the image i want to display is 300dpi , 400M letter size RGB. as your suggestion, i can display it in an extract region. but i still want to display it in the whole view client. and my view is derived from ScrollView, but still can not display it.

            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