檢視原始碼 wxGraphicsMatrix (wx v2.4.3)
wxGraphicsMatrix
是一個仿射矩陣的原生表示法。
其內容是特定且私有的,因應不同的渲染器而異。實例會進行引用計數,因此可以像平常一樣進行賦值。取得有效實例的唯一方法是透過 wxGraphicsContext:createMatrix/2
或 wxGraphicsRenderer:createMatrix/2
。
這個類別繼承自,並且可以使用下列函式:
wxWidgets 文件:wxGraphicsMatrix
概要
函式
將傳入的矩陣與目前的矩陣串聯。
透過引數指標傳回矩陣的元件值。
反轉矩陣。
如果轉換矩陣的元素相等,則傳回 true。
如果這是單位矩陣,則傳回 true。
將此矩陣順時針旋轉(以弧度表示)。
縮放此矩陣。
等同於 set(This, [])
。
將矩陣設定為對應的值(預設值為單位矩陣)。
將此矩陣應用於距離(即。
將此矩陣應用於點。
平移此矩陣。
類型
-type wxGraphicsMatrix() :: wx:wx_object().
函式
-spec concat(This, T) -> ok when This :: wxGraphicsMatrix(), T :: wxGraphicsMatrix().
將傳入的矩陣與目前的矩陣串聯。
結果轉換的效果是先將 t
中的轉換應用於座標,然後將目前矩陣中的轉換應用於座標。
-spec get(This) -> Result when Result :: {A :: number(), B :: number(), C :: number(), D :: number(), Tx :: number(), Ty :: number()}, This :: wxGraphicsMatrix().
透過引數指標傳回矩陣的元件值。
-spec invert(This) -> ok when This :: wxGraphicsMatrix().
反轉矩陣。
-spec isEqual(This, T) -> boolean() when This :: wxGraphicsMatrix(), T :: wxGraphicsMatrix().
如果轉換矩陣的元素相等,則傳回 true。
-spec isIdentity(This) -> boolean() when This :: wxGraphicsMatrix().
如果這是單位矩陣,則傳回 true。
-spec rotate(This, Angle) -> ok when This :: wxGraphicsMatrix(), Angle :: number().
將此矩陣順時針旋轉(以弧度表示)。
-spec scale(This, XScale, YScale) -> ok when This :: wxGraphicsMatrix(), XScale :: number(), YScale :: number().
縮放此矩陣。
-spec set(This) -> ok when This :: wxGraphicsMatrix().
等同於 set(This, [])
。
-spec set(This, [Option]) -> ok when This :: wxGraphicsMatrix(), Option :: {a, number()} | {b, number()} | {c, number()} | {d, number()} | {tx, number()} | {ty, number()}.
將矩陣設定為對應的值(預設值為單位矩陣)。
-spec transformDistance(This) -> {Dx :: number(), Dy :: number()} when This :: wxGraphicsMatrix().
將此矩陣應用於距離(即。
執行除平移之外的所有轉換)。
-spec transformPoint(This) -> {X :: number(), Y :: number()} when This :: wxGraphicsMatrix().
將此矩陣應用於點。
-spec translate(This, Dx, Dy) -> ok when This :: wxGraphicsMatrix(), Dx :: number(), Dy :: number().
平移此矩陣。