Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've got a PictureBox where the end user can draw rectangles, lines,

ellipses and freehand on an image. Everything works fine, except for an

occasional OutOfMemoryException. It only occurs when drawing freehand and

there's already a figure (StartFigure is called again), the first line is

added to the figure and DrawPath is called. The exception occurs (only

occasionally) when the call is made to DrawPath. It only happens when the

pen width >= 2. I can get around the exception by leaving the mouse over

the image with the left button pressed down, and pressing the space bar to

clear the exception.

 

Dave

  • Administrators
Posted

If you run task manager (or better still Process Explorer) does the memory usage increase steadily or is it a single increase that causes this problem?

Also are you correctly disposing all the GDI+ objects you are creating in your drawing code? If in doubt please post the relevant code and somebody may be able to spot a problem (GDI+ isn't my strong point :))

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...