ホーム › Graphics.Direct2D › D2D1_HWND_RENDER_TARGET_PROPERTIES
D2D1_HWND_RENDER_TARGET_PROPERTIES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| hwnd | HWND | 8/4 | +0 | +0 | 描画先となるウィンドウのハンドル。 |
| pixelSize | D2D_SIZE_U | 8 | +8 | +4 | レンダーターゲットのピクセル単位サイズ。 |
| presentOptions | D2D1_PRESENT_OPTIONS | 4 | +16 | +12 | 表示動作を制御するオプションフラグ(即時表示等)。 |
各言語での定義
#include <windows.h>
// D2D_SIZE_U (x64 8 / x86 8 バイト)
typedef struct D2D_SIZE_U {
DWORD width;
DWORD height;
} D2D_SIZE_U;
// D2D1_HWND_RENDER_TARGET_PROPERTIES (x64 24 / x86 16 バイト)
typedef struct D2D1_HWND_RENDER_TARGET_PROPERTIES {
HWND hwnd;
D2D_SIZE_U pixelSize;
D2D1_PRESENT_OPTIONS presentOptions;
} D2D1_HWND_RENDER_TARGET_PROPERTIES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D_SIZE_U
{
public uint width;
public uint height;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D1_HWND_RENDER_TARGET_PROPERTIES
{
public IntPtr hwnd;
public D2D_SIZE_U pixelSize;
public int presentOptions;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D_SIZE_U
Public width As UInteger
Public height As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D1_HWND_RENDER_TARGET_PROPERTIES
Public hwnd As IntPtr
Public pixelSize As D2D_SIZE_U
Public presentOptions As Integer
End Structureimport ctypes
from ctypes import wintypes
class D2D_SIZE_U(ctypes.Structure):
_fields_ = [
("width", wintypes.DWORD),
("height", wintypes.DWORD),
]
class D2D1_HWND_RENDER_TARGET_PROPERTIES(ctypes.Structure):
_fields_ = [
("hwnd", ctypes.c_void_p),
("pixelSize", D2D_SIZE_U),
("presentOptions", ctypes.c_int),
]#[repr(C)]
pub struct D2D_SIZE_U {
pub width: u32,
pub height: u32,
}
#[repr(C)]
pub struct D2D1_HWND_RENDER_TARGET_PROPERTIES {
pub hwnd: *mut core::ffi::c_void,
pub pixelSize: D2D_SIZE_U,
pub presentOptions: i32,
}import "golang.org/x/sys/windows"
type D2D_SIZE_U struct {
width uint32
height uint32
}
type D2D1_HWND_RENDER_TARGET_PROPERTIES struct {
hwnd uintptr
pixelSize D2D_SIZE_U
presentOptions int32
}type
D2D_SIZE_U = record
width: DWORD;
height: DWORD;
end;
D2D1_HWND_RENDER_TARGET_PROPERTIES = record
hwnd: Pointer;
pixelSize: D2D_SIZE_U;
presentOptions: Integer;
end;const D2D_SIZE_U = extern struct {
width: u32,
height: u32,
};
const D2D1_HWND_RENDER_TARGET_PROPERTIES = extern struct {
hwnd: ?*anyopaque,
pixelSize: D2D_SIZE_U,
presentOptions: i32,
};type
D2D_SIZE_U {.bycopy.} = object
width: uint32
height: uint32
D2D1_HWND_RENDER_TARGET_PROPERTIES {.bycopy.} = object
hwnd: pointer
pixelSize: D2D_SIZE_U
presentOptions: int32struct D2D_SIZE_U
{
uint width;
uint height;
}
struct D2D1_HWND_RENDER_TARGET_PROPERTIES
{
void* hwnd;
D2D_SIZE_U pixelSize;
int presentOptions;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D2D1_HWND_RENDER_TARGET_PROPERTIES サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; hwnd : HWND (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pixelSize : D2D_SIZE_U (+4, 8byte) varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; presentOptions : D2D1_PRESENT_OPTIONS (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D2D1_HWND_RENDER_TARGET_PROPERTIES サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; hwnd : HWND (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pixelSize : D2D_SIZE_U (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; presentOptions : D2D1_PRESENT_OPTIONS (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D2D_SIZE_U
#field int width
#field int height
#endstruct
#defstruct global D2D1_HWND_RENDER_TARGET_PROPERTIES
#field intptr hwnd
#field D2D_SIZE_U pixelSize
#field int presentOptions
#endstruct
stdim st, D2D1_HWND_RENDER_TARGET_PROPERTIES ; NSTRUCT 変数を確保
st->presentOptions = 100
mes "presentOptions=" + st->presentOptions