ホーム › Graphics.GdiPlus › GdipSetPathGradientSurroundColorsWithCount
GdipSetPathGradientSurroundColorsWithCount
関数パスグラデーションの境界色を数とともに設定する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipSetPathGradientSurroundColorsWithCount(
GpPathGradient* brush,
const DWORD* color,
INT* count
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| brush | GpPathGradient* | inout |
| color | DWORD* | in |
| count | INT* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipSetPathGradientSurroundColorsWithCount(
GpPathGradient* brush,
const DWORD* color,
INT* count
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetPathGradientSurroundColorsWithCount(
IntPtr brush, // GpPathGradient* in/out
ref uint color, // DWORD*
ref int count // INT* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetPathGradientSurroundColorsWithCount(
brush As IntPtr, ' GpPathGradient* in/out
ByRef color As UInteger, ' DWORD*
ByRef count As Integer ' INT* in/out
) As Integer
End Function' brush : GpPathGradient* in/out
' color : DWORD*
' count : INT* in/out
Declare PtrSafe Function GdipSetPathGradientSurroundColorsWithCount 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
GdipSetPathGradientSurroundColorsWithCount = ctypes.windll.gdiplus.GdipSetPathGradientSurroundColorsWithCount
GdipSetPathGradientSurroundColorsWithCount.restype = ctypes.c_int
GdipSetPathGradientSurroundColorsWithCount.argtypes = [
ctypes.c_void_p, # brush : GpPathGradient* in/out
ctypes.POINTER(wintypes.DWORD), # color : DWORD*
ctypes.POINTER(ctypes.c_int), # count : INT* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipSetPathGradientSurroundColorsWithCount = Fiddle::Function.new(
lib['GdipSetPathGradientSurroundColorsWithCount'],
[
Fiddle::TYPE_VOIDP, # brush : GpPathGradient* in/out
Fiddle::TYPE_VOIDP, # color : DWORD*
Fiddle::TYPE_VOIDP, # count : INT* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipSetPathGradientSurroundColorsWithCount(
brush: *mut GpPathGradient, // GpPathGradient* in/out
color: *const u32, // DWORD*
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 GdipSetPathGradientSurroundColorsWithCount(IntPtr brush, ref uint color, ref int count);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipSetPathGradientSurroundColorsWithCount' -Namespace Win32 -PassThru
# $api::GdipSetPathGradientSurroundColorsWithCount(brush, color, count)#uselib "gdiplus.dll"
#func global GdipSetPathGradientSurroundColorsWithCount "GdipSetPathGradientSurroundColorsWithCount" sptr, sptr, sptr
; GdipSetPathGradientSurroundColorsWithCount varptr(brush), varptr(color), varptr(count) ; 戻り値は stat
; brush : GpPathGradient* in/out -> "sptr"
; color : DWORD* -> "sptr"
; count : INT* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipSetPathGradientSurroundColorsWithCount "GdipSetPathGradientSurroundColorsWithCount" var, var, var ; res = GdipSetPathGradientSurroundColorsWithCount(brush, color, count) ; brush : GpPathGradient* in/out -> "var" ; color : DWORD* -> "var" ; count : INT* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipSetPathGradientSurroundColorsWithCount "GdipSetPathGradientSurroundColorsWithCount" sptr, sptr, sptr ; res = GdipSetPathGradientSurroundColorsWithCount(varptr(brush), varptr(color), varptr(count)) ; brush : GpPathGradient* in/out -> "sptr" ; color : DWORD* -> "sptr" ; count : INT* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipSetPathGradientSurroundColorsWithCount(GpPathGradient* brush, DWORD* color, INT* count) #uselib "gdiplus.dll" #cfunc global GdipSetPathGradientSurroundColorsWithCount "GdipSetPathGradientSurroundColorsWithCount" var, var, var ; res = GdipSetPathGradientSurroundColorsWithCount(brush, color, count) ; brush : GpPathGradient* in/out -> "var" ; color : DWORD* -> "var" ; count : INT* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipSetPathGradientSurroundColorsWithCount(GpPathGradient* brush, DWORD* color, INT* count) #uselib "gdiplus.dll" #cfunc global GdipSetPathGradientSurroundColorsWithCount "GdipSetPathGradientSurroundColorsWithCount" intptr, intptr, intptr ; res = GdipSetPathGradientSurroundColorsWithCount(varptr(brush), varptr(color), varptr(count)) ; brush : GpPathGradient* in/out -> "intptr" ; color : DWORD* -> "intptr" ; count : INT* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipSetPathGradientSurroundColorsWithCount = gdiplus.NewProc("GdipSetPathGradientSurroundColorsWithCount")
)
// brush (GpPathGradient* in/out), color (DWORD*), count (INT* in/out)
r1, _, err := procGdipSetPathGradientSurroundColorsWithCount.Call(
uintptr(brush),
uintptr(color),
uintptr(count),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipSetPathGradientSurroundColorsWithCount(
brush: Pointer; // GpPathGradient* in/out
color: Pointer; // DWORD*
count: Pointer // INT* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipSetPathGradientSurroundColorsWithCount';result := DllCall("gdiplus\GdipSetPathGradientSurroundColorsWithCount"
, "Ptr", brush ; GpPathGradient* in/out
, "Ptr", color ; DWORD*
, "Ptr", count ; INT* in/out
, "Int") ; return: Status●GdipSetPathGradientSurroundColorsWithCount(brush, color, count) = DLL("gdiplus.dll", "int GdipSetPathGradientSurroundColorsWithCount(void*, void*, void*)")
# 呼び出し: GdipSetPathGradientSurroundColorsWithCount(brush, color, count)
# brush : GpPathGradient* in/out -> "void*"
# color : DWORD* -> "void*"
# count : INT* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。