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

GdipGetPathGradientSurroundColorsWithCount

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

シグネチャ

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

Status GdipGetPathGradientSurroundColorsWithCount(
    GpPathGradient* brush,
    DWORD* color,
    INT* count
);

パラメーター

名前方向
brushGpPathGradient*in
colorDWORD*out
countINT*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

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

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPathGradientSurroundColorsWithCount = gdiplus.NewProc("GdipGetPathGradientSurroundColorsWithCount")
)

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