thanks,
to make things clear:
if i'd like to transform back with new matrix, then i should do this:
PointF p = new Point(4, 4);
Matrix mx = new Matrix();
mx.Scale(3, 3);
mx.Invert();
PointF[] pts = new PointF[] { p };
mx.TransformPoints(pts);
Matrix mx2 = new Matrix();
mx2.Scale(3, 3);
mx2.TransformPoints(pts);
now (in theory) my pts[0] should be 4,4
in fact it is as i tested this.
but i don't get this. i thought that when i do something like this:
Matrix mx = new Matrix();
mx.Scale(3,3);
mx.Invert();
mx.TransformPoints(pts);
Matrix mx2 = new Matrix();
mx2.Invert();
mx2.Scale(1.0/3,1.0/3);
mx2.TransformPoints(pts);
then i'll get the same results. but i dont.
[quoted text, click to view] Andrew Kirillov wrote:
> Hello.
>
> Here is the code, which makes tranform and back transform. But, be careful
> using the same with Point instead of PointF. In the case of Point it will no
> be always possible to transform back, because you are loosing part of
> information.
>
> PointF p = new Point(4, 4);
> Matrix mx = new Matrix();
> mx.Scale(3, 3);
> mx.Invert();
>
> PointF[] pts = new PointF[] { p };
> mx.TransformPoints(pts);
>
> System.Diagnostics.Debug.WriteLine("x = " + pts[0].X + ", y = " + pts[0].Y);
>
> mx.Invert();
> mx.TransformPoints(pts);
>
> System.Diagnostics.Debug.WriteLine("x = " + pts[0].X + ", y = " + pts[0].Y);
>