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

Graphics

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

I've since gone off and done some reading on .net CF graphics, in the process I came across some code which I've implemented into my project.

private Bitmap LoadBitmapResource(string strName)
{
Assembly assembly = Assembly.GetExecutingAssembly();
string strRes = "Rotate_Test.images.gauge." + strName;
Stream stream = assembly.GetManifestResourceStream(strRes);
Bitmap bmp = null;
try
{
bmp = new Bitmap(stream);
}
catch { }
stream.Close();

return bmp;
}

private void DisposeBitmap(ref Bitmap bmp)
{
if (bmp != null)
{
bmp.Dispose();
}
bmp = null;
}

In the Panel Paint method I have the following.

private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
DisposeBitmap(ref bmpDraw);
//Get the Bitmap to draw
bmpDraw = LoadBitmapResource("backTilt" + (strResNum) + ".bmp");

g.DrawImage(bmpDraw, 10, 10);
}

The above is still using up memory for every image which is displayed, it seems like nothing is being freed up. I haven't started looking at double buffering as for now I'm more concerned with relasing the memory used.

Thanks for your suggestion

regards
Gemma
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 
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 

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.