Click here to Skip to main content
15,909,898 members
Home / Discussions / C#
   

C#

 
GeneralRe: Drawing column headers Pin
Amberite005-Mar-04 9:13
Amberite005-Mar-04 9:13 
GeneralRe: Drawing column headers Pin
Heath Stewart5-Mar-04 9:37
protectorHeath Stewart5-Mar-04 9:37 
GeneralRe: Drawing column headers Pin
Amberite005-Mar-04 9:41
Amberite005-Mar-04 9:41 
GeneralInstall remote Window Service Pin
hxxbin5-Mar-04 4:43
hxxbin5-Mar-04 4:43 
GeneralCounting Items post RowFilter in a DataView Pin
MrEyes5-Mar-04 3:33
MrEyes5-Mar-04 3:33 
QuestionHow can I pull multiple icons from a single embedded bitmap? Pin
AppMaker885-Mar-04 1:20
AppMaker885-Mar-04 1:20 
AnswerRe: How can I pull multiple icons from a single embedded bitmap? Pin
Heath Stewart5-Mar-04 6:14
protectorHeath Stewart5-Mar-04 6:14 
GeneralGraphics, Bitmaps, and a Process that doesn't close Pin
Rendall4-Mar-04 23:35
Rendall4-Mar-04 23:35 
I am creating a bitmap drawing a pie chart and saving it as a gif in my windows app.
I am then linking and empbedding that gif (in the same process) into another app that generates a pdf on the fly.

However, when I close my windows app, the process does not end and i have to do it manually. Here's the code where i'm creating the gif.

const int width = 500, height = 200;
Bitmap objBitmap = new Bitmap(width, height);

Graphics objGraphics = Graphics.FromImage(objBitmap);

objGraphics = Graphics.FromImage(objBitmap);

objGraphics.FillRectangle(new SolidBrush(Color.White), 0, 0, width, height);

DrawSpendingPieChart(ref objGraphics, alName, alNumber);

string path = storageFolder + "\\" + clientId + "chart1.gif";

try
{
objBitmap.Save(path, ImageFormat.Gif);
}
catch(Exception ioe)
{
throw ioe;
}
finally
{
// clean up...
objBitmap = null;
objGraphics = null;
}

r.cbChart1 = path;

Without the link to this gif, it works fine. The pdf generator links and embeds other gifs outside my windows app fine.

I have isolated the problem to the gif i'm creating. It seemingly remains in memory(even though i set it to null once saved) and is linked to my windows app process: and if used, it keeps my app open.

Does it have to do with Graphics.FromImage() creating a memory stream and retaining it even after I have set objBitmap to null?

Any help?

Dave
GeneralRe: Graphics, Bitmaps, and a Process that doesn't close Pin
Heath Stewart5-Mar-04 6:07
protectorHeath Stewart5-Mar-04 6:07 
GeneralRe: Graphics, Bitmaps, and a Process that doesn't close Pin
Rendall12-Mar-04 20:01
Rendall12-Mar-04 20:01 
GeneralRe: Graphics, Bitmaps, and a Process that doesn't close Pin
Rendall13-Mar-04 0:11
Rendall13-Mar-04 0:11 
GeneralMarshalling Problem Pin
nvenkat4-Mar-04 23:02
nvenkat4-Mar-04 23:02 
GeneralRe: Marshalling Problem Pin
Roman Rodov4-Mar-04 23:51
Roman Rodov4-Mar-04 23:51 
GeneralRe: Marshalling Problem Pin
nvenkat5-Mar-04 19:19
nvenkat5-Mar-04 19:19 
Generalchecklistbox problem Pin
ASGill4-Mar-04 21:34
ASGill4-Mar-04 21:34 
GeneralRe: checklistbox problem Pin
Mazdak4-Mar-04 21:40
Mazdak4-Mar-04 21:40 
GeneralRe: checklistbox problem Pin
ASGill4-Mar-04 22:09
ASGill4-Mar-04 22:09 
GeneralRe: checklistbox problem Pin
Mazdak4-Mar-04 22:25
Mazdak4-Mar-04 22:25 
GeneralRe: checklistbox problem Pin
ASGill5-Mar-04 0:53
ASGill5-Mar-04 0:53 
GeneralRe: checklistbox problem Pin
MasudM5-Mar-04 1:50
MasudM5-Mar-04 1:50 
GeneralRe: checklistbox problem Pin
Mazdak5-Mar-04 4:51
Mazdak5-Mar-04 4:51 
GeneralRe: checklistbox problem Pin
ASGill5-Mar-04 7:04
ASGill5-Mar-04 7:04 
GeneralYCbCr image construction Pin
yyyychan4-Mar-04 21:12
yyyychan4-Mar-04 21:12 
GeneralI2C communication Pin
yyyychan4-Mar-04 21:05
yyyychan4-Mar-04 21:05 
GeneralRe: I2C communication Pin
Heath Stewart5-Mar-04 6:19
protectorHeath Stewart5-Mar-04 6:19 

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.