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

Graphics

 
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 
Hi Gemma,

1.
your code looks fine to me, with one comment: if every OnPaint does a Disposeand a Load,
and assuming bmpDraw is not used elsewhere, why not do it after the DrawImage (hence:
load,draw,dispose)?

2.
calling Dispose is good, it frees unmanaged resources immediately (if any), and marks
managed objects for garbage collection, which only occurs when the garbage collector feels
a need (i.e. when memory is low when a new object is being created, say in a "new" statement).

So it is not abnormal to see a high memory usage, as long as it comes down every so often,
and does not lead to an "out of memory" situation.

As a test, you could add a big object to your main class (to occupy memory) and see
how well the app does under those circumstances, so add a line such as:
private byte[] dummyBytes=new byte[1024*1024]; // permanently occupies 1MB

3.
If you are still not satisfied, here are some questions:
- what is it that makes you worry?
- how many images are there?
- how big is each image (in pixels and in file size)?

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


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 
QuestionWhat causes the DirectShow EC_COMPLETE event to be set Pin
Yair Han31-Dec-07 7:33
Yair Han31-Dec-07 7:33 
GeneralRe: What causes the DirectShow EC_COMPLETE event to be set Pin
tanvon malik2-Jan-08 4:05
tanvon malik2-Jan-08 4:05 
QuestionHow to Load .X File using DirectX9? Pin
snehat28-Dec-07 18:28
snehat28-Dec-07 18:28 
AnswerRe: How to Load .X File using DirectX9? Pin
MarkB7773-Jan-08 12:19
MarkB7773-Jan-08 12:19 
Generalcharacter segmentation Pin
zhaojun27-Dec-07 18:04
zhaojun27-Dec-07 18:04 
General.max to .x conversion Pin
DanB198324-Dec-07 3:37
DanB198324-Dec-07 3:37 
GeneralRe: .max to .x conversion Pin
Paul Conrad24-Dec-07 11:32
professionalPaul Conrad24-Dec-07 11:32 
GeneralRe: .max to .x conversion Pin
DanB198324-Dec-07 21:42
DanB198324-Dec-07 21:42 
GeneralRe: .max to .x conversion Pin
El Corazon24-Dec-07 11:53
El Corazon24-Dec-07 11:53 

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.