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

GdipSetEmpty

関数
リージョンを空の範囲に設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetEmpty(
    GpRegion* region
);

パラメーター

名前方向
regionGpRegion*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipSetEmpty = ctypes.windll.gdiplus.GdipSetEmpty
GdipSetEmpty.restype = ctypes.c_int
GdipSetEmpty.argtypes = [
    ctypes.c_void_p,  # region : GpRegion* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetEmpty = gdiplus.NewProc("GdipSetEmpty")
)

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