c# - Should I dispose() the Matrix returned by Graphics.Transform? -


i need draw primitives graphics object different transformation matrix. wonder should dispose matrix or graphics me:

using (var g = graphics.fromimage(...)) {     ... code ...     var tmp = g.transform;     g.translatetransform(...);     ... code ...     g.transform = tmp;     // should call tmp.dispose() here?     tmp.dispose();     ... code use g .... } 

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform.aspx

says:

because matrix returned , transform property copy of geometric transform, should dispose of matrix when no longer need it.

i not need after g.transform = tmp;, should dispose it?

quoting msdn, graphics.transform...

gets or sets a copy of geometric world transformation graphics.

(emphasis mine.)

when call transform, you're making copy of matrix, , should dispose yourself. long own them, it's idea dispose objects implement idisposable, , preferably using using(...) syntax.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -