寻找后/ pre解释/套翻译(在Matrix对象),以及如何使用它们如何使用、对象、pre、Matrix

2023-09-05 05:43:42 作者:南歌初渝

借助文档是pretty的含糊不清,什么是真正发生时,这些方法被使用。有人能解释矩阵实际上是如何影响了它被设置为位图?他们用这个词串连在那里,但我不清楚如何这个词适用于坐标数据(已经只用它对于字符串操作之前)。

解决方案

的设置方法将取代目前的矩阵与新价值,不顾一切的矩阵包含之前。在pre和POST方法将之前或任何当前矩阵包含后申请一个新的转变。

在这个例子中,旋转将被忽略,因为我们使用的是集方法和米将只包含一个翻译

  

矩阵M =新的Matrix();

     

m.setRotate(90);

     

m.setTranslate(100,100);

在这个例子中,最后的矩阵将是一个翻译再旋转的

  

矩阵M =新的Matrix();

     

m.setTranslate(100,100);

     

m.postRotate(90);

超酷的 Vim 搜索技巧

在最后一个例子中,最终的矩阵将是一个旋转再平移:

  

矩阵M =新的Matrix();

     

m.setTranslate(100,100);

     

米preRotate(90);

有没有这(相当长)后的一些详细信息:

http://www.satyakomatineni.com/akc/display?url=displaynoteimpurl&ownerUserId=satya&reportId=2898

希望它帮助。

The documentation is pretty vague as to what is actually happening when these methods are used. Can someone explain how Matrix actually affects the Bitmap that it's being set to? They use the term concatenate in there, but I'm unclear on how that term applies to coordinate data (having only used it in regard to string manipulation before).

解决方案

The set-methods will replace the current Matrix with new values, disregarding whatever the Matrix contained before. The pre and post method will apply a new transformation before or after whatever the current Matrix contains.

In this example, the rotation will be ignored since we are using the set method and the m will only contain a translation:

Matrix m = new Matrix();

m.setRotate(90);

m.setTranslate(100, 100);

In this example, the final matrix will be a translation followed by a rotation:

Matrix m = new Matrix();

m.setTranslate(100, 100);

m.postRotate(90);

In the final example, the final matrix will be a rotation followed by a translation:

Matrix m = new Matrix();

m.setTranslate(100, 100);

m.preRotate(90);

There is some more information in this (rather lengthy) post:

http://www.satyakomatineni.com/akc/display?url=displaynoteimpurl&ownerUserId=satya&reportId=2898

Hope it helps.