ホーム › Graphics.GdiPlus › GdipSetPenStartCap
GdipSetPenStartCap
関数ペンで描く線の始点の端点キャップ形状を設定する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipSetPenStartCap(
GpPen* pen,
LineCap startCap
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pen | GpPen* | inout |
| startCap | LineCap | in |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipSetPenStartCap(
GpPen* pen,
LineCap startCap
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetPenStartCap(
IntPtr pen, // GpPen* in/out
int startCap // LineCap
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetPenStartCap(
pen As IntPtr, ' GpPen* in/out
startCap As Integer ' LineCap
) As Integer
End Function' pen : GpPen* in/out
' startCap : LineCap
Declare PtrSafe Function GdipSetPenStartCap Lib "gdiplus" ( _
ByVal pen As LongPtr, _
ByVal startCap As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipSetPenStartCap = ctypes.windll.gdiplus.GdipSetPenStartCap
GdipSetPenStartCap.restype = ctypes.c_int
GdipSetPenStartCap.argtypes = [
ctypes.c_void_p, # pen : GpPen* in/out
ctypes.c_int, # startCap : LineCap
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipSetPenStartCap = Fiddle::Function.new(
lib['GdipSetPenStartCap'],
[
Fiddle::TYPE_VOIDP, # pen : GpPen* in/out
Fiddle::TYPE_INT, # startCap : LineCap
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipSetPenStartCap(
pen: *mut GpPen, // GpPen* in/out
startCap: i32 // LineCap
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipSetPenStartCap(IntPtr pen, int startCap);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipSetPenStartCap' -Namespace Win32 -PassThru
# $api::GdipSetPenStartCap(pen, startCap)#uselib "gdiplus.dll"
#func global GdipSetPenStartCap "GdipSetPenStartCap" sptr, sptr
; GdipSetPenStartCap varptr(pen), startCap ; 戻り値は stat
; pen : GpPen* in/out -> "sptr"
; startCap : LineCap -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipSetPenStartCap "GdipSetPenStartCap" var, int ; res = GdipSetPenStartCap(pen, startCap) ; pen : GpPen* in/out -> "var" ; startCap : LineCap -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipSetPenStartCap "GdipSetPenStartCap" sptr, int ; res = GdipSetPenStartCap(varptr(pen), startCap) ; pen : GpPen* in/out -> "sptr" ; startCap : LineCap -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipSetPenStartCap(GpPen* pen, LineCap startCap) #uselib "gdiplus.dll" #cfunc global GdipSetPenStartCap "GdipSetPenStartCap" var, int ; res = GdipSetPenStartCap(pen, startCap) ; pen : GpPen* in/out -> "var" ; startCap : LineCap -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipSetPenStartCap(GpPen* pen, LineCap startCap) #uselib "gdiplus.dll" #cfunc global GdipSetPenStartCap "GdipSetPenStartCap" intptr, int ; res = GdipSetPenStartCap(varptr(pen), startCap) ; pen : GpPen* in/out -> "intptr" ; startCap : LineCap -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipSetPenStartCap = gdiplus.NewProc("GdipSetPenStartCap")
)
// pen (GpPen* in/out), startCap (LineCap)
r1, _, err := procGdipSetPenStartCap.Call(
uintptr(pen),
uintptr(startCap),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipSetPenStartCap(
pen: Pointer; // GpPen* in/out
startCap: Integer // LineCap
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipSetPenStartCap';result := DllCall("gdiplus\GdipSetPenStartCap"
, "Ptr", pen ; GpPen* in/out
, "Int", startCap ; LineCap
, "Int") ; return: Status●GdipSetPenStartCap(pen, startCap) = DLL("gdiplus.dll", "int GdipSetPenStartCap(void*, int)")
# 呼び出し: GdipSetPenStartCap(pen, startCap)
# pen : GpPen* in/out -> "void*"
# startCap : LineCap -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。