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

GdipCreateAdjustableArrowCap

関数
指定した高さ・幅で調整可能な矢印型の端点キャップを作成する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipCreateAdjustableArrowCap(
    FLOAT height,
    FLOAT width,
    BOOL isFilled,
    GpAdjustableArrowCap** cap
);

パラメーター

名前方向
heightFLOATin
widthFLOATin
isFilledBOOLin
capGpAdjustableArrowCap**inout

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipCreateAdjustableArrowCap(
    FLOAT height,
    FLOAT width,
    BOOL isFilled,
    GpAdjustableArrowCap** cap
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipCreateAdjustableArrowCap(
    float height,   // FLOAT
    float width,   // FLOAT
    bool isFilled,   // BOOL
    IntPtr cap   // GpAdjustableArrowCap** in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipCreateAdjustableArrowCap(
    height As Single,   ' FLOAT
    width As Single,   ' FLOAT
    isFilled As Boolean,   ' BOOL
    cap As IntPtr   ' GpAdjustableArrowCap** in/out
) As Integer
End Function
' height : FLOAT
' width : FLOAT
' isFilled : BOOL
' cap : GpAdjustableArrowCap** in/out
Declare PtrSafe Function GdipCreateAdjustableArrowCap Lib "gdiplus" ( _
    ByVal height As Single, _
    ByVal width As Single, _
    ByVal isFilled As Long, _
    ByVal cap As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipCreateAdjustableArrowCap = ctypes.windll.gdiplus.GdipCreateAdjustableArrowCap
GdipCreateAdjustableArrowCap.restype = ctypes.c_int
GdipCreateAdjustableArrowCap.argtypes = [
    ctypes.c_float,  # height : FLOAT
    ctypes.c_float,  # width : FLOAT
    wintypes.BOOL,  # isFilled : BOOL
    ctypes.c_void_p,  # cap : GpAdjustableArrowCap** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipCreateAdjustableArrowCap = Fiddle::Function.new(
  lib['GdipCreateAdjustableArrowCap'],
  [
    Fiddle::TYPE_FLOAT,  # height : FLOAT
    Fiddle::TYPE_FLOAT,  # width : FLOAT
    Fiddle::TYPE_INT,  # isFilled : BOOL
    Fiddle::TYPE_VOIDP,  # cap : GpAdjustableArrowCap** in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipCreateAdjustableArrowCap(
        height: f32,  // FLOAT
        width: f32,  // FLOAT
        isFilled: i32,  // BOOL
        cap: *mut *mut GpAdjustableArrowCap  // GpAdjustableArrowCap** in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipCreateAdjustableArrowCap(float height, float width, bool isFilled, IntPtr cap);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipCreateAdjustableArrowCap' -Namespace Win32 -PassThru
# $api::GdipCreateAdjustableArrowCap(height, width, isFilled, cap)
#uselib "gdiplus.dll"
#func global GdipCreateAdjustableArrowCap "GdipCreateAdjustableArrowCap" float, float, sptr, sptr
; GdipCreateAdjustableArrowCap height, width, isFilled, varptr(cap)   ; 戻り値は stat
; height : FLOAT -> "float"
; width : FLOAT -> "float"
; isFilled : BOOL -> "sptr"
; cap : GpAdjustableArrowCap** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipCreateAdjustableArrowCap "GdipCreateAdjustableArrowCap" float, float, int, var
; res = GdipCreateAdjustableArrowCap(height, width, isFilled, cap)
; height : FLOAT -> "float"
; width : FLOAT -> "float"
; isFilled : BOOL -> "int"
; cap : GpAdjustableArrowCap** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipCreateAdjustableArrowCap(FLOAT height, FLOAT width, BOOL isFilled, GpAdjustableArrowCap** cap)
#uselib "gdiplus.dll"
#cfunc global GdipCreateAdjustableArrowCap "GdipCreateAdjustableArrowCap" float, float, int, var
; res = GdipCreateAdjustableArrowCap(height, width, isFilled, cap)
; height : FLOAT -> "float"
; width : FLOAT -> "float"
; isFilled : BOOL -> "int"
; cap : GpAdjustableArrowCap** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipCreateAdjustableArrowCap = gdiplus.NewProc("GdipCreateAdjustableArrowCap")
)

// height (FLOAT), width (FLOAT), isFilled (BOOL), cap (GpAdjustableArrowCap** in/out)
r1, _, err := procGdipCreateAdjustableArrowCap.Call(
	uintptr(math.Float32bits(height)),
	uintptr(math.Float32bits(width)),
	uintptr(isFilled),
	uintptr(cap),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。
function GdipCreateAdjustableArrowCap(
  height: Single;   // FLOAT
  width: Single;   // FLOAT
  isFilled: BOOL;   // BOOL
  cap: Pointer   // GpAdjustableArrowCap** in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipCreateAdjustableArrowCap';
result := DllCall("gdiplus\GdipCreateAdjustableArrowCap"
    , "Float", height   ; FLOAT
    , "Float", width   ; FLOAT
    , "Int", isFilled   ; BOOL
    , "Ptr", cap   ; GpAdjustableArrowCap** in/out
    , "Int")   ; return: Status
●GdipCreateAdjustableArrowCap(height, width, isFilled, cap) = DLL("gdiplus.dll", "int GdipCreateAdjustableArrowCap(float, float, bool, void*)")
# 呼び出し: GdipCreateAdjustableArrowCap(height, width, isFilled, cap)
# height : FLOAT -> "float"
# width : FLOAT -> "float"
# isFilled : BOOL -> "bool"
# cap : GpAdjustableArrowCap** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。