Click here to Skip to main content
15,899,639 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Graphics, Bitmaps, and a Process that doesn't close Pin
Heath Stewart5-Mar-04 6:07
protectorHeath Stewart5-Mar-04 6:07 
When a Type implements IDisposable like the Graphics and Bitmap classes, you must call Dispose before nullifying the instance variable (which really isn't necessary):
Bitmap bmp = null;
Graphics g = null;
try
{
  bmp = new Bitmap(32, 32);
  g = Graphics.FromImage(bmp);
  //...
}
finally
{
  if (g != null) g.Dispose();
  if (bmp != null) bmp.Dispose();
}
In C#, you can use the using statement to do the same thing as above:
using (Bitmap bmp = new Bitmap(32, 32))
{
  using (Graphics g = Graphics.FromImage(bmp))
  {
    // ...
  }
}


 

Microsoft MVP, Visual C#
My Articles
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 
GeneralQuestion about Casting and Inheritance Pin
tsunsau7174-Mar-04 19:37
tsunsau7174-Mar-04 19:37 

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.