ホーム › Graphics.Direct2D › D2D1_STROKE_STYLE_PROPERTIES
D2D1_STROKE_STYLE_PROPERTIES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| startCap | D2D1_CAP_STYLE | 4 | +0 | +0 | 線の始端のキャップ形状。 |
| endCap | D2D1_CAP_STYLE | 4 | +4 | +4 | 線の終端のキャップ形状。 |
| dashCap | D2D1_CAP_STYLE | 4 | +8 | +8 | 破線の各ダッシュ端のキャップ形状。 |
| lineJoin | D2D1_LINE_JOIN | 4 | +12 | +12 | 線分の接合部の形状(マイター/ベベル等)。 |
| miterLimit | FLOAT | 4 | +16 | +16 | マイター接合の最大延長比率。 |
| dashStyle | D2D1_DASH_STYLE | 4 | +20 | +20 | 破線パターンの種類。 |
| dashOffset | FLOAT | 4 | +24 | +24 | 破線パターンの開始位置オフセット。 |
各言語での定義
#include <windows.h>
// D2D1_STROKE_STYLE_PROPERTIES (x64 28 / x86 28 バイト)
typedef struct D2D1_STROKE_STYLE_PROPERTIES {
D2D1_CAP_STYLE startCap;
D2D1_CAP_STYLE endCap;
D2D1_CAP_STYLE dashCap;
D2D1_LINE_JOIN lineJoin;
FLOAT miterLimit;
D2D1_DASH_STYLE dashStyle;
FLOAT dashOffset;
} D2D1_STROKE_STYLE_PROPERTIES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D1_STROKE_STYLE_PROPERTIES
{
public int startCap;
public int endCap;
public int dashCap;
public int lineJoin;
public float miterLimit;
public int dashStyle;
public float dashOffset;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D1_STROKE_STYLE_PROPERTIES
Public startCap As Integer
Public endCap As Integer
Public dashCap As Integer
Public lineJoin As Integer
Public miterLimit As Single
Public dashStyle As Integer
Public dashOffset As Single
End Structureimport ctypes
from ctypes import wintypes
class D2D1_STROKE_STYLE_PROPERTIES(ctypes.Structure):
_fields_ = [
("startCap", ctypes.c_int),
("endCap", ctypes.c_int),
("dashCap", ctypes.c_int),
("lineJoin", ctypes.c_int),
("miterLimit", ctypes.c_float),
("dashStyle", ctypes.c_int),
("dashOffset", ctypes.c_float),
]#[repr(C)]
pub struct D2D1_STROKE_STYLE_PROPERTIES {
pub startCap: i32,
pub endCap: i32,
pub dashCap: i32,
pub lineJoin: i32,
pub miterLimit: f32,
pub dashStyle: i32,
pub dashOffset: f32,
}import "golang.org/x/sys/windows"
type D2D1_STROKE_STYLE_PROPERTIES struct {
startCap int32
endCap int32
dashCap int32
lineJoin int32
miterLimit float32
dashStyle int32
dashOffset float32
}type
D2D1_STROKE_STYLE_PROPERTIES = record
startCap: Integer;
endCap: Integer;
dashCap: Integer;
lineJoin: Integer;
miterLimit: Single;
dashStyle: Integer;
dashOffset: Single;
end;const D2D1_STROKE_STYLE_PROPERTIES = extern struct {
startCap: i32,
endCap: i32,
dashCap: i32,
lineJoin: i32,
miterLimit: f32,
dashStyle: i32,
dashOffset: f32,
};type
D2D1_STROKE_STYLE_PROPERTIES {.bycopy.} = object
startCap: int32
endCap: int32
dashCap: int32
lineJoin: int32
miterLimit: float32
dashStyle: int32
dashOffset: float32struct D2D1_STROKE_STYLE_PROPERTIES
{
int startCap;
int endCap;
int dashCap;
int lineJoin;
float miterLimit;
int dashStyle;
float dashOffset;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D2D1_STROKE_STYLE_PROPERTIES サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; startCap : D2D1_CAP_STYLE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; endCap : D2D1_CAP_STYLE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dashCap : D2D1_CAP_STYLE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lineJoin : D2D1_LINE_JOIN (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; miterLimit : FLOAT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dashStyle : D2D1_DASH_STYLE (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dashOffset : FLOAT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D2D1_STROKE_STYLE_PROPERTIES
#field int startCap
#field int endCap
#field int dashCap
#field int lineJoin
#field float miterLimit
#field int dashStyle
#field float dashOffset
#endstruct
stdim st, D2D1_STROKE_STYLE_PROPERTIES ; NSTRUCT 変数を確保
st->startCap = 100
mes "startCap=" + st->startCap