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