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