2017-09-28 11 views
0

android에서 할 수있는 것은 matrix.setScale(-1, 1); to FLIP_HORIZONTAL 이미지입니다. 저는 델파이와 같은에서 동일한 작업을 수행하려고 :delphi에서 matrix.setScale (-1, 1)과 동일한 기능은 무엇입니까?

aMatrix := Canvas.Matrix * TMatrix.CreateScaling(-1, 1); 
Canvas.SetMatrix(aMatrix); 

을하지만 내가

+0

내가 확실히 알 수는 없지만, 그 행렬 곱셈을 알고는 교환 법칙이 성립하지 않습니다, IEA의 * B는 –

+0

아니, 몰랐 * B와 동일하지 않습니다 ... 하지만 네가 맞다고 생각 하긴하지만 확실치는 않습니다. – noa

답변

0
(그래서 매트릭스와 함께 연주, 캔버스 내부에) 내가 델파이에서 이미지를 FLIP_HORIZONTAL 어떻게 그리워 했는가 :(작동하지 않을거야?

내가 발견.

aMatrixRotationCenter.X := (width/2) + Canvas.Matrix.m31; 
aMatrixRotationCenter.Y := (height/2) + Canvas.Matrix.m32; 
aMatrix := Canvas.Matrix * TMatrix.CreateTranslation(-aMatrixRotationCenter.X,-aMatrixRotationCenter.Y); 
aMatrix := aMatrix * TMatrix.CreateScaling(-1, 1); // matrix.setScale(-1, 1); 
aMatrix := aMatrix * TMatrix.CreateTranslation(aMatrixRotationCenter.X,aMatrixRotationCenter.Y); 
Canvas.SetMatrix(aMatrix);