Hi,
I understand that if one creates a Graphics object, as in
Graphics.FromImage(), then after using it it seems only logical do dispose it.
However, when one receives a Graphics object in a parameter (as in OnPaint(
PaintEventArgs)), then I assume it might be possible that this object be used
after the end of the current method, andçor ultimately disposed by the
internall code that created it in the first place. So, my gut tells me not to
Dispose this received Graphics.
Am I correct?

Signature
Thanks in advance,
Juan Dent, M.Sc.
Peter Duniho - 07 Mar 2008 01:32 GMT
> [...]
> However, when one receives a Graphics object in a parameter (as in
[quoted text clipped - 5 lines]
> not to
> Dispose this received Graphics.
Right. Don't dispose things you don't own. You only own it if either you
created it, or the whatever did create it has explicitly handed ownership
to you.
Pete