Click here to Skip to main content
15,913,685 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: Drawing Outside The Form Pin
Dave Kreskowiak14-Jan-08 7:46
mveDave Kreskowiak14-Jan-08 7:46 
GeneralRe: Drawing Outside The Form Pin
The ANZAC14-Jan-08 12:30
The ANZAC14-Jan-08 12:30 
GeneralRe: Drawing Outside The Form Pin
Smithers-Jones28-Feb-08 7:54
Smithers-Jones28-Feb-08 7:54 
Question3D mesh material Pin
Raza568010-Jan-08 12:29
Raza568010-Jan-08 12:29 
GeneralRe: 3D mesh material Pin
Californian210-Jan-08 12:36
Californian210-Jan-08 12:36 
GeneralUsing 8 bit-per-pixel grayscale bitmaps with GDI+ Pin
Californian210-Jan-08 12:28
Californian210-Jan-08 12:28 
GeneralPictureBox using too much memory Pin
gembob4-Jan-08 6:08
gembob4-Jan-08 6:08 
GeneralRe: PictureBox using too much memory Pin
Luc Pattyn4-Jan-08 7:52
sitebuilderLuc Pattyn4-Jan-08 7:52 
Hi,

I don't see anything wrong with your object disposal, so I expect the garbage collector
will clean up memory if need be.

However I think you are spending way too much CPU power to achieve your goals. This is
how I would do it:

- replace the PictureBox by a simple Panel (or an inherited Panel that sets its
ControlStyles to double-buffered for better graphics);

- do the drawing in the Panel's OnPaint method, based on a single class member (int side);
it gives you a Graphics for free (which you should not dispose!);

- when you want to change the gauge, change the variable (side) and call your Panel's
Invalidate method


If you only have a dozen PNG images, you may even consider keeping them alive in memory
all the time.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Happy 2008!


GeneralRe: PictureBox using too much memory Pin
Pete O'Hanlon4-Jan-08 10:37
mvePete O'Hanlon4-Jan-08 10:37 
GeneralRe: PictureBox using too much memory Pin
Luc Pattyn4-Jan-08 11:01
sitebuilderLuc Pattyn4-Jan-08 11:01 
GeneralRe: PictureBox using too much memory Pin
Pete O'Hanlon5-Jan-08 9:48
mvePete O'Hanlon5-Jan-08 9:48 
GeneralRe: PictureBox using too much memory Pin
Luc Pattyn5-Jan-08 11:34
sitebuilderLuc Pattyn5-Jan-08 11:34 
GeneralRe: PictureBox using too much memory Pin
Luc Pattyn5-Jan-08 11:47
sitebuilderLuc Pattyn5-Jan-08 11:47 
GeneralRe: PictureBox using too much memory Pin
gembob9-Jan-08 3:40
gembob9-Jan-08 3:40 
GeneralRe: PictureBox using too much memory Pin
Luc Pattyn9-Jan-08 4:22
sitebuilderLuc Pattyn9-Jan-08 4:22 
GeneralRe: PictureBox using too much memory Pin
gembob1-Feb-08 7:22
gembob1-Feb-08 7:22 
GeneralRe: PictureBox using too much memory Pin
Luc Pattyn1-Feb-08 10:12
sitebuilderLuc Pattyn1-Feb-08 10:12 
GeneralRe: PictureBox using too much memory Pin
gembob4-Feb-08 3:38
gembob4-Feb-08 3:38 
GeneralRe: PictureBox using too much memory Pin
Luc Pattyn4-Feb-08 4:54
sitebuilderLuc Pattyn4-Feb-08 4:54 
GeneralHelp Required : Creating DIBSection from raw image data ( Searched all possible forums, could not find answer ) Pin
Sharath Jagannath3-Jan-08 20:49
Sharath Jagannath3-Jan-08 20:49 
GeneralRe: Help Required : Creating DIBSection from raw image data ( Searched all possible forums, could not find answer ) Pin
Mark Salsbery4-Jan-08 8:00
Mark Salsbery4-Jan-08 8:00 
GeneralRe: Help Required : Creating DIBSection from raw image data ( Searched all possible forums, could not find answer ) Pin
Sharath Jagannath6-Jan-08 19:15
Sharath Jagannath6-Jan-08 19:15 
Questionopengl 1.2 Pin
Dr Willy2-Jan-08 22:25
Dr Willy2-Jan-08 22:25 
GeneralRe: opengl 1.2 Pin
Tim Craig2-Jan-08 23:22
Tim Craig2-Jan-08 23:22 
GeneralRe: opengl 1.2 Pin
Dr Willy4-Jan-08 9:07
Dr Willy4-Jan-08 9:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.