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

D2D1_STROKE_STYLE_PROPERTIES1

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

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

フィールド

フィールドサイズx64x86説明
startCapD2D1_CAP_STYLE4+0+0線の始端のキャップ形状。
endCapD2D1_CAP_STYLE4+4+4線の終端のキャップ形状。
dashCapD2D1_CAP_STYLE4+8+8破線の各ダッシュ端のキャップ形状。
lineJoinD2D1_LINE_JOIN4+12+12線分の接合部の形状。
miterLimitFLOAT4+16+16マイター接合の最大延長比率。
dashStyleD2D1_DASH_STYLE4+20+20破線パターンの種類。
dashOffsetFLOAT4+24+24破線パターンの開始位置オフセット。
transformTypeD2D1_STROKE_TRANSFORM_TYPE4+28+28ストローク幅へ変換を適用する方式を示す値。

各言語での定義

#include <windows.h>

// D2D1_STROKE_STYLE_PROPERTIES1  (x64 32 / x86 32 バイト)
typedef struct D2D1_STROKE_STYLE_PROPERTIES1 {
    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_TRANSFORM_TYPE transformType;
} D2D1_STROKE_STYLE_PROPERTIES1;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D1_STROKE_STYLE_PROPERTIES1
{
    public int startCap;
    public int endCap;
    public int dashCap;
    public int lineJoin;
    public float miterLimit;
    public int dashStyle;
    public float dashOffset;
    public int transformType;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D1_STROKE_STYLE_PROPERTIES1
    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
    Public transformType As Integer
End Structure
import ctypes
from ctypes import wintypes

class D2D1_STROKE_STYLE_PROPERTIES1(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),
        ("transformType", ctypes.c_int),
    ]
#[repr(C)]
pub struct D2D1_STROKE_STYLE_PROPERTIES1 {
    pub startCap: i32,
    pub endCap: i32,
    pub dashCap: i32,
    pub lineJoin: i32,
    pub miterLimit: f32,
    pub dashStyle: i32,
    pub dashOffset: f32,
    pub transformType: i32,
}
import "golang.org/x/sys/windows"

type D2D1_STROKE_STYLE_PROPERTIES1 struct {
	startCap int32
	endCap int32
	dashCap int32
	lineJoin int32
	miterLimit float32
	dashStyle int32
	dashOffset float32
	transformType int32
}
type
  D2D1_STROKE_STYLE_PROPERTIES1 = record
    startCap: Integer;
    endCap: Integer;
    dashCap: Integer;
    lineJoin: Integer;
    miterLimit: Single;
    dashStyle: Integer;
    dashOffset: Single;
    transformType: Integer;
  end;
const D2D1_STROKE_STYLE_PROPERTIES1 = extern struct {
    startCap: i32,
    endCap: i32,
    dashCap: i32,
    lineJoin: i32,
    miterLimit: f32,
    dashStyle: i32,
    dashOffset: f32,
    transformType: i32,
};
type
  D2D1_STROKE_STYLE_PROPERTIES1 {.bycopy.} = object
    startCap: int32
    endCap: int32
    dashCap: int32
    lineJoin: int32
    miterLimit: float32
    dashStyle: int32
    dashOffset: float32
    transformType: int32
struct D2D1_STROKE_STYLE_PROPERTIES1
{
    int startCap;
    int endCap;
    int dashCap;
    int lineJoin;
    float miterLimit;
    int dashStyle;
    float dashOffset;
    int transformType;
}

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_PROPERTIES1 サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 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 も可)
; transformType : D2D1_STROKE_TRANSFORM_TYPE (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D2D1_STROKE_STYLE_PROPERTIES1
    #field int startCap
    #field int endCap
    #field int dashCap
    #field int lineJoin
    #field float miterLimit
    #field int dashStyle
    #field float dashOffset
    #field int transformType
#endstruct

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