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