ホーム › Graphics.DirectWrite › DWRITE_MATRIX
DWRITE_MATRIX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| m11 | FLOAT | 4 | +0 | +0 | 変換行列の1行1列要素(X方向の拡大成分)。 |
| m12 | FLOAT | 4 | +4 | +4 | 変換行列の1行2列要素(XからYへのせん断成分)。 |
| m21 | FLOAT | 4 | +8 | +8 | 変換行列の2行1列要素(YからXへのせん断成分)。 |
| m22 | FLOAT | 4 | +12 | +12 | 変換行列の2行2列要素(Y方向の拡大成分)。 |
| dx | FLOAT | 4 | +16 | +16 | X方向の平行移動量。 |
| dy | FLOAT | 4 | +20 | +20 | Y方向の平行移動量。 |
各言語での定義
#include <windows.h>
// DWRITE_MATRIX (x64 24 / x86 24 バイト)
typedef struct DWRITE_MATRIX {
FLOAT m11;
FLOAT m12;
FLOAT m21;
FLOAT m22;
FLOAT dx;
FLOAT dy;
} DWRITE_MATRIX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DWRITE_MATRIX
{
public float m11;
public float m12;
public float m21;
public float m22;
public float dx;
public float dy;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DWRITE_MATRIX
Public m11 As Single
Public m12 As Single
Public m21 As Single
Public m22 As Single
Public dx As Single
Public dy As Single
End Structureimport ctypes
from ctypes import wintypes
class DWRITE_MATRIX(ctypes.Structure):
_fields_ = [
("m11", ctypes.c_float),
("m12", ctypes.c_float),
("m21", ctypes.c_float),
("m22", ctypes.c_float),
("dx", ctypes.c_float),
("dy", ctypes.c_float),
]#[repr(C)]
pub struct DWRITE_MATRIX {
pub m11: f32,
pub m12: f32,
pub m21: f32,
pub m22: f32,
pub dx: f32,
pub dy: f32,
}import "golang.org/x/sys/windows"
type DWRITE_MATRIX struct {
m11 float32
m12 float32
m21 float32
m22 float32
dx float32
dy float32
}type
DWRITE_MATRIX = record
m11: Single;
m12: Single;
m21: Single;
m22: Single;
dx: Single;
dy: Single;
end;const DWRITE_MATRIX = extern struct {
m11: f32,
m12: f32,
m21: f32,
m22: f32,
dx: f32,
dy: f32,
};type
DWRITE_MATRIX {.bycopy.} = object
m11: float32
m12: float32
m21: float32
m22: float32
dx: float32
dy: float32struct DWRITE_MATRIX
{
float m11;
float m12;
float m21;
float m22;
float dx;
float dy;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DWRITE_MATRIX サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; m11 : FLOAT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; m12 : FLOAT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; m21 : FLOAT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; m22 : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dx : FLOAT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dy : FLOAT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DWRITE_MATRIX
#field float m11
#field float m12
#field float m21
#field float m22
#field float dx
#field float dy
#endstruct
stdim st, DWRITE_MATRIX ; NSTRUCT 変数を確保
st->m11 = 100
mes "m11=" + st->m11