Results 1 to 3 of 3

Thread: Exception Handling[RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Rattlerr's Avatar
    Join Date
    Jul 2005
    Location
    FloralCity,Florida
    Posts
    269

    Resolved Exception Handling[RESOLVED]

    I'm working with a OnPaintBackGround and trying to Catch an PaintEventArgs e ....It has a certain format for its size that i'm trying to change but for now i'm working on Catching the Exception thats Thrown during Debug...

    What i'm trying to do is too get the OnPaint onto a Picture Box that i have on my Form

    Here is the Code i'm working with just cant figure out what i need to put in past the "catch" part..

    Code:
    protected override void OnPaintBackground(PaintEventArgs e)
            {
                try
                {
                    // Draw the current background image stretched to fill the full screen
                    e.Graphics.DrawImage(Backgroundimage[currentImageIndex], 578, 231, Size.Width, Size.Height);
                }
                catch (FormatException fEx)
                {
                    // This is what i need to fill in to catch the above problem  e.Graphics.DrawImage(Backgroundimage[currentImageIndex], and so on
                }
    I get a "NullReference was UnHandles" it high lights the e.Graphics.DrawImage Line and in the Locals Lists the Following::
    -----------------------------------------------------
    this Cannot obtain value of local or argument '<this>' as it is not available at this instruction pointer, possibly because it has been optimized away. MediaViewer.Main
    -------------------------------------------------

    + e {ClipRectangle = {X=0,Y=0,Width=823,Height=586}} System.Windows.Forms.PaintEventArgs

    }
    ----------------------------------------------------
    Last edited by Rattlerr; Feb 28th, 2006 at 01:36 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width