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

GdipGetPathGradientSurroundColorCount

関数
パスグラデーションの境界色の数を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPathGradientSurroundColorCount(
    GpPathGradient* brush,
    INT* count
);

パラメーター

名前方向説明
brushGpPathGradient*inout対象のパスグラデーションブラシへのポインタ。
countINT*inout境界色の個数を受け取るポインタ。

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetPathGradientSurroundColorCount = ctypes.windll.gdiplus.GdipGetPathGradientSurroundColorCount
GdipGetPathGradientSurroundColorCount.restype = ctypes.c_int
GdipGetPathGradientSurroundColorCount.argtypes = [
    ctypes.c_void_p,  # brush : GpPathGradient* in/out
    ctypes.POINTER(ctypes.c_int),  # count : INT* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPathGradientSurroundColorCount = gdiplus.NewProc("GdipGetPathGradientSurroundColorCount")
)

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