Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 852019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:31:27+00:00 2026-05-15T07:31:27+00:00

I am attempting to display a very large graphical representation of some data. I

  • 0

I am attempting to display a very large graphical representation of some data. I am using a bitmap for persistent storage of the image and e.Graphics.DrawImage(myBitmap, new Point(0,0)) in the onPaint of a PictureBox control on my form. I have noticed (and heard mentioned on other sites) that if my image has a height or width greater than 2^15, I get a Parameter not Valid exception, but I have not found any official documentation of this limit.

Is this 2^15 image size limit a definite, official part of Graphics.DrawImage? Are there any simple workarounds to render my entire image onto the form?

(Yes, the pictureBox is set to the same size as the image, or bigger. Side question though, should I just be using the onPaint of the form itself instead of a picture box?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:31:28+00:00Added an answer on May 15, 2026 at 7:31 am

    You have a few issues here. First, it’s not fundamentally possible to display an image this large (unless you have some sort of insanely huge monitor or multiple monitor setup) without shrinking it down to a size that will fit on a normal screen.

    You can perform this size reduction using Graphics.DrawImage, but keep in mind that even with a high-quality InterpolationMode, the interpolation is only done on at most a few neighboring pixels, which means there is a limit to the maximum amount you can reduce an image without serious loss of information (usually down to 25%).

    Second, a Bitmap object in .Net is a lot more complicated than just a simple array of pixels. Bitmaps are sometimes created in video RAM instead of general program memory, which limits their maximum size more severely (in the compact framework, as one example, one of the Bitmap constructors creates the pixel data in video RAM, which is limited to 4MB instead of the 32MB normally available to a .NET process). As a result, there is no documented maximum size for a Bitmap – this is an internal implementation detail (affected as well by any already-existing bitmaps) that a programmer can only discover the hard way, by getting a thrown exception if it’s too big. So using a Bitmap to store an arbitrarily large set of data points is not going to work.

    Your best approach here would probably be to store your data as an ordinary two-dimensional array (of type int[,], probably), which could be arbitrarily large without throwing an OutOfMemoryException (although not without making your computer go swapfile-crazy), and then write a custom method that copies from this array into an actual (and practically-sized) Bitmap. You would then copy from this Bitmap to your PictureBox (or, more simply, just set this Bitmap as the picture box’s Image property – it’s best to avoid the Paint method whenever possible).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to create a very large image in Java like so: BufferedImage bi
I'm attempting to display some text in my program using (say) Windows GDI and
I'm attempting to display some text in my program using (say) Windows GDI and
We're attempting to display two series of data on the same chart. The first
I'm attempting to display a listview that includes an image previously downloaded from the
I am currently attempting to implement a custom gridview interface to display data from
I'm attempting to display an image that was downloaded from a website, with the
I am attempting to display a .tif in Java using a minimal number of
im attempting to display a value from a many to many relationship in my
I'm attempting to display the contents of a Facebook page wall on an external

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.