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

GdipGetPenCompoundArray

関数
ペンの複合線パターンの配列を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPenCompoundArray(
    GpPen* pen,
    FLOAT* dash,
    INT count
);

パラメーター

名前方向
penGpPen*inout
dashFLOAT*inout
countINTin

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetPenCompoundArray = ctypes.windll.gdiplus.GdipGetPenCompoundArray
GdipGetPenCompoundArray.restype = ctypes.c_int
GdipGetPenCompoundArray.argtypes = [
    ctypes.c_void_p,  # pen : GpPen* in/out
    ctypes.POINTER(ctypes.c_float),  # dash : FLOAT* in/out
    ctypes.c_int,  # count : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPenCompoundArray = gdiplus.NewProc("GdipGetPenCompoundArray")
)

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