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

GdipGetPenEndCap

関数
ペンで描く線の終点の端点キャップ形状を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPenEndCap(
    GpPen* pen,
    LineCap* endCap
);

パラメーター

名前方向
penGpPen*inout
endCapLineCap*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetPenEndCap = ctypes.windll.gdiplus.GdipGetPenEndCap
GdipGetPenEndCap.restype = ctypes.c_int
GdipGetPenEndCap.argtypes = [
    ctypes.c_void_p,  # pen : GpPen* in/out
    ctypes.c_void_p,  # endCap : LineCap* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPenEndCap = gdiplus.NewProc("GdipGetPenEndCap")
)

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