> Hello,
>
[quoted text clipped - 27 lines]
> Thanks for any help
> Alex
You are disposing the Matrix object taht you just assigned to the
Graphics object. That means that the Graphics object contains a Matrix
object that is no longer valid.
Get the Matrix object that the Graphics object contains from start, then
put that back when you are done.

Signature
Göran Andersson
_____
http://www.guffa.com
Alex - 11 Oct 2007 10:08 GMT
> > Hello,
> >
[quoted text clipped - 34 lines]
> Get the Matrix object that the Graphics object contains from start, then
> put that back when you are done.
I did that but It didn't solve the problem, I still get the Out of Memory
Exception after turning the object several times.
{
Matrix matrix = new Matrix();
Matrix save = graphics.Transform;
matrix.RotateAt(Angle, m_center, MatrixOrder.Append);
graphics.Transform = matrix;
graphics.DrawImage(m_image, m_rect);
matrix.RotateAt(-Angle, m_center, MatrixOrder.Append);
graphics.Transform = matrix;
graphics.Transform = safe;
matrix.Dispose();
}
Göran Andersson - 11 Oct 2007 13:18 GMT
>> Get the Matrix object that the Graphics object contains from start, then
>> put that back when you are done.
[quoted text clipped - 13 lines]
> matrix.Dispose();
> }
You put the matrix in the variable "save", then try to read it from the
variable "safe"?
I suppose that's just a typo, but you should consider to post the code
that you are actually using instead of some other code that you are not
using. Noone can find an error in your code by looking at some other code.

Signature
Göran Andersson
_____
http://www.guffa.com
Alex - 11 Oct 2007 13:01 GMT
After further investigation of the Problem I thought the title is misleading,
I opened a new thread "Graphics.DrawImage throws "Out of Memory" Exception".
> > Hello,
> >
[quoted text clipped - 34 lines]
> Get the Matrix object that the Graphics object contains from start, then
> put that back when you are done.