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

GdipSetCustomLineCapBaseCap

関数
カスタム端点キャップの基準となる端点キャップ形状を設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetCustomLineCapBaseCap(
    GpCustomLineCap* customCap,
    LineCap baseCap
);

パラメーター

名前方向
customCapGpCustomLineCap*inout
baseCapLineCapin

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipSetCustomLineCapBaseCap(
    GpCustomLineCap* customCap,
    LineCap baseCap
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetCustomLineCapBaseCap(
    IntPtr customCap,   // GpCustomLineCap* in/out
    int baseCap   // LineCap
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetCustomLineCapBaseCap(
    customCap As IntPtr,   ' GpCustomLineCap* in/out
    baseCap As Integer   ' LineCap
) As Integer
End Function
' customCap : GpCustomLineCap* in/out
' baseCap : LineCap
Declare PtrSafe Function GdipSetCustomLineCapBaseCap Lib "gdiplus" ( _
    ByVal customCap As LongPtr, _
    ByVal baseCap As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipSetCustomLineCapBaseCap = ctypes.windll.gdiplus.GdipSetCustomLineCapBaseCap
GdipSetCustomLineCapBaseCap.restype = ctypes.c_int
GdipSetCustomLineCapBaseCap.argtypes = [
    ctypes.c_void_p,  # customCap : GpCustomLineCap* in/out
    ctypes.c_int,  # baseCap : LineCap
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetCustomLineCapBaseCap = gdiplus.NewProc("GdipSetCustomLineCapBaseCap")
)

// customCap (GpCustomLineCap* in/out), baseCap (LineCap)
r1, _, err := procGdipSetCustomLineCapBaseCap.Call(
	uintptr(customCap),
	uintptr(baseCap),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipSetCustomLineCapBaseCap(
  customCap: Pointer;   // GpCustomLineCap* in/out
  baseCap: Integer   // LineCap
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipSetCustomLineCapBaseCap';
result := DllCall("gdiplus\GdipSetCustomLineCapBaseCap"
    , "Ptr", customCap   ; GpCustomLineCap* in/out
    , "Int", baseCap   ; LineCap
    , "Int")   ; return: Status
●GdipSetCustomLineCapBaseCap(customCap, baseCap) = DLL("gdiplus.dll", "int GdipSetCustomLineCapBaseCap(void*, int)")
# 呼び出し: GdipSetCustomLineCapBaseCap(customCap, baseCap)
# customCap : GpCustomLineCap* in/out -> "void*"
# baseCap : LineCap -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。