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矢印キャップの高さ(ペン幅単位)を表すFLOAT。
widthFLOATin矢印キャップの幅(ペン幅単位)を表すFLOAT。
isFilledBOOLin矢印を塗りつぶすかを示すBOOL。TRUEで塗りつぶし。
capGpAdjustableArrowCap**inout生成された可変矢印キャップを受け取るGpAdjustableArrowCap**。

戻り値の型: 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)。
const std = @import("std");

extern "gdiplus" fn GdipCreateAdjustableArrowCap(
    height: f32, // FLOAT
    width: f32, // FLOAT
    isFilled: i32, // BOOL
    cap: [*c][*c]GpAdjustableArrowCap // GpAdjustableArrowCap** in/out
) callconv(std.os.windows.WINAPI) i32;
proc GdipCreateAdjustableArrowCap(
    height: float32,  # FLOAT
    width: float32,  # FLOAT
    isFilled: int32,  # BOOL
    cap: ptr GpAdjustableArrowCap  # GpAdjustableArrowCap** in/out
): int32 {.importc: "GdipCreateAdjustableArrowCap", stdcall, dynlib: "gdiplus.dll".}
pragma(lib, "gdiplus");
extern(Windows)
int GdipCreateAdjustableArrowCap(
    float height,   // FLOAT
    float width,   // FLOAT
    int isFilled,   // BOOL
    GpAdjustableArrowCap** cap   // GpAdjustableArrowCap** in/out
);
ccall((:GdipCreateAdjustableArrowCap, "gdiplus.dll"), stdcall, Int32,
      (Float32, Float32, Int32, Ptr{GpAdjustableArrowCap}),
      height, width, isFilled, cap)
# height : FLOAT -> Float32
# width : FLOAT -> Float32
# isFilled : BOOL -> Int32
# cap : GpAdjustableArrowCap** in/out -> Ptr{GpAdjustableArrowCap}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t GdipCreateAdjustableArrowCap(
    float height,
    float width,
    int32_t isFilled,
    void* cap);
]]
local gdiplus = ffi.load("gdiplus")
-- gdiplus.GdipCreateAdjustableArrowCap(height, width, isFilled, cap)
-- height : FLOAT
-- width : FLOAT
-- isFilled : BOOL
-- cap : GpAdjustableArrowCap** in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('gdiplus.dll');
const GdipCreateAdjustableArrowCap = lib.func('__stdcall', 'GdipCreateAdjustableArrowCap', 'int32_t', ['float', 'float', 'int32_t', 'void *']);
// GdipCreateAdjustableArrowCap(height, width, isFilled, cap)
// height : FLOAT -> 'float'
// width : FLOAT -> 'float'
// isFilled : BOOL -> 'int32_t'
// cap : GpAdjustableArrowCap** in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("gdiplus.dll", {
  GdipCreateAdjustableArrowCap: { parameters: ["f32", "f32", "i32", "pointer"], result: "i32" },
});
// lib.symbols.GdipCreateAdjustableArrowCap(height, width, isFilled, cap)
// height : FLOAT -> "f32"
// width : FLOAT -> "f32"
// isFilled : BOOL -> "i32"
// cap : GpAdjustableArrowCap** in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t GdipCreateAdjustableArrowCap(
    float height,
    float width,
    int32_t isFilled,
    void* cap);
C, "gdiplus.dll");
// $ffi->GdipCreateAdjustableArrowCap(height, width, isFilled, cap);
// height : FLOAT
// width : FLOAT
// isFilled : BOOL
// cap : GpAdjustableArrowCap** in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Gdiplus extends StdCallLibrary {
    Gdiplus INSTANCE = Native.load("gdiplus", Gdiplus.class);
    int GdipCreateAdjustableArrowCap(
        float height,   // FLOAT
        float width,   // FLOAT
        boolean isFilled,   // BOOL
        Pointer cap   // GpAdjustableArrowCap** in/out
    );
}
@[Link("gdiplus")]
lib Libgdiplus
  fun GdipCreateAdjustableArrowCap = GdipCreateAdjustableArrowCap(
    height : Float32,   # FLOAT
    width : Float32,   # FLOAT
    isFilled : Int32,   # BOOL
    cap : GpAdjustableArrowCap**   # GpAdjustableArrowCap** in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef GdipCreateAdjustableArrowCapNative = Int32 Function(Float, Float, Int32, Pointer<Void>);
typedef GdipCreateAdjustableArrowCapDart = int Function(double, double, int, Pointer<Void>);
final GdipCreateAdjustableArrowCap = DynamicLibrary.open('gdiplus.dll')
    .lookupFunction<GdipCreateAdjustableArrowCapNative, GdipCreateAdjustableArrowCapDart>('GdipCreateAdjustableArrowCap');
// height : FLOAT -> Float
// width : FLOAT -> Float
// isFilled : BOOL -> Int32
// cap : GpAdjustableArrowCap** in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function GdipCreateAdjustableArrowCap(
  height: Single;   // FLOAT
  width: Single;   // FLOAT
  isFilled: BOOL;   // BOOL
  cap: Pointer   // GpAdjustableArrowCap** in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipCreateAdjustableArrowCap';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "GdipCreateAdjustableArrowCap"
  c_GdipCreateAdjustableArrowCap :: CFloat -> CFloat -> CInt -> Ptr () -> IO Int32
-- height : FLOAT -> CFloat
-- width : FLOAT -> CFloat
-- isFilled : BOOL -> CInt
-- cap : GpAdjustableArrowCap** in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let gdipcreateadjustablearrowcap =
  foreign "GdipCreateAdjustableArrowCap"
    (float @-> float @-> int32_t @-> (ptr void) @-> returning int32_t)
(* height : FLOAT -> float *)
(* width : FLOAT -> float *)
(* isFilled : BOOL -> int32_t *)
(* cap : GpAdjustableArrowCap** in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library gdiplus (t "gdiplus.dll"))
(cffi:use-foreign-library gdiplus)

(cffi:defcfun ("GdipCreateAdjustableArrowCap" gdip-create-adjustable-arrow-cap :convention :stdcall) :int32
  (height :float)   ; FLOAT
  (width :float)   ; FLOAT
  (is-filled :int32)   ; BOOL
  (cap :pointer))   ; GpAdjustableArrowCap** in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $GdipCreateAdjustableArrowCap = Win32::API::More->new('gdiplus',
    'int GdipCreateAdjustableArrowCap(float height, float width, BOOL isFilled, LPVOID cap)');
# my $ret = $GdipCreateAdjustableArrowCap->Call($height, $width, $isFilled, $cap);
# height : FLOAT -> float
# width : FLOAT -> float
# isFilled : BOOL -> BOOL
# cap : GpAdjustableArrowCap** in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型