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

GdipSetPathGradientWrapMode

関数
パスグラデーションブラシのラップモードを設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetPathGradientWrapMode(
    GpPathGradient* brush,
    WrapMode wrapmode
);

パラメーター

名前方向
brushGpPathGradient*inout
wrapmodeWrapModein

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipSetPathGradientWrapMode = ctypes.windll.gdiplus.GdipSetPathGradientWrapMode
GdipSetPathGradientWrapMode.restype = ctypes.c_int
GdipSetPathGradientWrapMode.argtypes = [
    ctypes.c_void_p,  # brush : GpPathGradient* in/out
    ctypes.c_int,  # wrapmode : WrapMode
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetPathGradientWrapMode = gdiplus.NewProc("GdipSetPathGradientWrapMode")
)

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