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

  • Home
  • SEARCH
  • 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 989525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:48:24+00:00 2026-05-16T05:48:24+00:00

I am rendering an interpolation curve thusly: e.Graphics.DrawLines(new Pen(Color.Red), _interpolationPoints.ToArray()); which sometimes throws an

  • 0

I am rendering an interpolation curve thusly:

e.Graphics.DrawLines(new Pen(Color.Red), _interpolationPoints.ToArray());

which sometimes throws an OverflowException.

Examination of the _interpolationPoints array shows some very large values in scientific notation e.g. {X = 0.0 Y = -1.985174E+10}

I suspect that Y = -1.985174E+10 is a value that GDI+ cannot handle. That’s fine but what are the max/min X and Y values into which I can draw and so constrain the data (and warn the user) rather than catching the overflow exception during paint? Are the limits documented?

For example, I would like to do something like this:

if (yVal < float.MinValue || yval > float.MaxValue) 
      throw new OverflowException("Interpolation value too large to be rendered.");

during the population of the _interpolationPoints array and stop the process. (float mix/max does not work btw. i still get the exception.)

  • 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-16T05:48:25+00:00Added an answer on May 16, 2026 at 5:48 am

    OK, I needed to know so I tested incrementally and came up with these limits:

    positive:    1,073,741,951
    negative:   -1,073,741,760
    

    The code I used looked something like this:

    int lastGoodVal = 0;
    for (int i = -1073000000; i > -1073832999; i -= 1)
    {
        g.DrawLine(Pens.Blue, new Point(0,0), new Point(0, i));
        lastGoodVal = i;
    }
    

    The loop above was the final test, stepping by 1, through a range of negative values established by earlier tests. As you can see, lastGoodVal holds the last successful painting iteration and therefore the real limit which I’ll use as a constant.

    I tried to correlate these numbers to a value in the .NET primitives but couldn’t. Each limit is close to the value of 2^30 but is not exactly on it. Any other insight would be much appreciated.

    I also only tested with the DrawLine method. It’s possible that different limits exist for other functions in the API but I have not had a chance to explore that yet.

    Also, after finishing this experiment and then Googling for the value 1073741951 I came across this article which correlates my findings. I also found this in a Mono code archive of some sort which mentions a near, though not exact correlation to float limits.

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

Sidebar

Related Questions

What is Rendering Tier in WPF. & What is Base class of WPF Graphics
Iam rendering a menu (using Zend framework) (zend_navigation) what iam doing is getting the
When rendering a django form using the as_p method, you traditionally get something like:
After rendering a view on a Post, a call to RenderAction inside the view
Cocoa isn't rendering the blue scroll button unless my scroll view is 4 rows
I'm currently rendering HTML input in a TextView like so: tv.setText(Html.fromHtml(<a href='test'>test</a>)); The HTML
Here's an odd rendering difference between IE and other browsers. Internet Explorer 8 Firefox
So I'm rendering a partial view in memory in order to direct the XSL-FO
let mtvCapView = Rendering.MTViewerCaptureViewProvider(subRead) let image = Image() let imageBinding = Data.Binding(ImageElement) imageBinding.Source <-
In IE7 standards mode rendering, a strange thing happens with the following body: <body>

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.