Win32 API 日本語リファレンス
ホームGraphics.CompositionSwapchain › PresentationTransform

PresentationTransform

構造体
サイズx64: 24 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
M11FLOAT4+0+02D変換行列の(1,1)成分。
M12FLOAT4+4+42D変換行列の(1,2)成分。
M21FLOAT4+8+82D変換行列の(2,1)成分。
M22FLOAT4+12+122D変換行列の(2,2)成分。
M31FLOAT4+16+162D変換行列の(3,1)成分。平行移動X。
M32FLOAT4+20+202D変換行列の(3,2)成分。平行移動Y。

各言語での定義

#include <windows.h>

// PresentationTransform  (x64 24 / x86 24 バイト)
typedef struct PresentationTransform {
    FLOAT M11;
    FLOAT M12;
    FLOAT M21;
    FLOAT M22;
    FLOAT M31;
    FLOAT M32;
} PresentationTransform;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PresentationTransform
{
    public float M11;
    public float M12;
    public float M21;
    public float M22;
    public float M31;
    public float M32;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PresentationTransform
    Public M11 As Single
    Public M12 As Single
    Public M21 As Single
    Public M22 As Single
    Public M31 As Single
    Public M32 As Single
End Structure
import ctypes
from ctypes import wintypes

class PresentationTransform(ctypes.Structure):
    _fields_ = [
        ("M11", ctypes.c_float),
        ("M12", ctypes.c_float),
        ("M21", ctypes.c_float),
        ("M22", ctypes.c_float),
        ("M31", ctypes.c_float),
        ("M32", ctypes.c_float),
    ]
#[repr(C)]
pub struct PresentationTransform {
    pub M11: f32,
    pub M12: f32,
    pub M21: f32,
    pub M22: f32,
    pub M31: f32,
    pub M32: f32,
}
import "golang.org/x/sys/windows"

type PresentationTransform struct {
	M11 float32
	M12 float32
	M21 float32
	M22 float32
	M31 float32
	M32 float32
}
type
  PresentationTransform = record
    M11: Single;
    M12: Single;
    M21: Single;
    M22: Single;
    M31: Single;
    M32: Single;
  end;
const PresentationTransform = extern struct {
    M11: f32,
    M12: f32,
    M21: f32,
    M22: f32,
    M31: f32,
    M32: f32,
};
type
  PresentationTransform {.bycopy.} = object
    M11: float32
    M12: float32
    M21: float32
    M22: float32
    M31: float32
    M32: float32
struct PresentationTransform
{
    float M11;
    float M12;
    float M21;
    float M22;
    float M31;
    float M32;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PresentationTransform サイズ: 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 も可)
; M31 : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; M32 : FLOAT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PresentationTransform
    #field float M11
    #field float M12
    #field float M21
    #field float M22
    #field float M31
    #field float M32
#endstruct

stdim st, PresentationTransform        ; NSTRUCT 変数を確保
st->M11 = 100
mes "M11=" + st->M11