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

ExtFloodFill

関数
境界色または領域色を指定して塗りつぶす。
DLLGDI32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL ExtFloodFill(
    HDC hdc,
    INT x,
    INT y,
    COLORREF color,
    EXT_FLOOD_FILL_TYPE type
);

パラメーター

名前方向
hdcHDCin
xINTin
yINTin
colorCOLORREFin
typeEXT_FLOOD_FILL_TYPEin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL ExtFloodFill(
    HDC hdc,
    INT x,
    INT y,
    COLORREF color,
    EXT_FLOOD_FILL_TYPE type
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern bool ExtFloodFill(
    IntPtr hdc,   // HDC
    int x,   // INT
    int y,   // INT
    uint color,   // COLORREF
    uint type   // EXT_FLOOD_FILL_TYPE
);
<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function ExtFloodFill(
    hdc As IntPtr,   ' HDC
    x As Integer,   ' INT
    y As Integer,   ' INT
    color As UInteger,   ' COLORREF
    type As UInteger   ' EXT_FLOOD_FILL_TYPE
) As Boolean
End Function
' hdc : HDC
' x : INT
' y : INT
' color : COLORREF
' type : EXT_FLOOD_FILL_TYPE
Declare PtrSafe Function ExtFloodFill Lib "gdi32" ( _
    ByVal hdc As LongPtr, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal color As Long, _
    ByVal type As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ExtFloodFill = ctypes.windll.gdi32.ExtFloodFill
ExtFloodFill.restype = wintypes.BOOL
ExtFloodFill.argtypes = [
    wintypes.HANDLE,  # hdc : HDC
    ctypes.c_int,  # x : INT
    ctypes.c_int,  # y : INT
    wintypes.DWORD,  # color : COLORREF
    wintypes.DWORD,  # type : EXT_FLOOD_FILL_TYPE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('GDI32.dll')
ExtFloodFill = Fiddle::Function.new(
  lib['ExtFloodFill'],
  [
    Fiddle::TYPE_VOIDP,  # hdc : HDC
    Fiddle::TYPE_INT,  # x : INT
    Fiddle::TYPE_INT,  # y : INT
    -Fiddle::TYPE_INT,  # color : COLORREF
    -Fiddle::TYPE_INT,  # type : EXT_FLOOD_FILL_TYPE
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdi32")]
extern "system" {
    fn ExtFloodFill(
        hdc: *mut core::ffi::c_void,  // HDC
        x: i32,  // INT
        y: i32,  // INT
        color: u32,  // COLORREF
        type: u32  // EXT_FLOOD_FILL_TYPE
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll")]
public static extern bool ExtFloodFill(IntPtr hdc, int x, int y, uint color, uint type);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_ExtFloodFill' -Namespace Win32 -PassThru
# $api::ExtFloodFill(hdc, x, y, color, type)
#uselib "GDI32.dll"
#func global ExtFloodFill "ExtFloodFill" sptr, sptr, sptr, sptr, sptr
; ExtFloodFill hdc, x, y, color, type   ; 戻り値は stat
; hdc : HDC -> "sptr"
; x : INT -> "sptr"
; y : INT -> "sptr"
; color : COLORREF -> "sptr"
; type : EXT_FLOOD_FILL_TYPE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "GDI32.dll"
#cfunc global ExtFloodFill "ExtFloodFill" sptr, int, int, int, int
; res = ExtFloodFill(hdc, x, y, color, type)
; hdc : HDC -> "sptr"
; x : INT -> "int"
; y : INT -> "int"
; color : COLORREF -> "int"
; type : EXT_FLOOD_FILL_TYPE -> "int"
; BOOL ExtFloodFill(HDC hdc, INT x, INT y, COLORREF color, EXT_FLOOD_FILL_TYPE type)
#uselib "GDI32.dll"
#cfunc global ExtFloodFill "ExtFloodFill" intptr, int, int, int, int
; res = ExtFloodFill(hdc, x, y, color, type)
; hdc : HDC -> "intptr"
; x : INT -> "int"
; y : INT -> "int"
; color : COLORREF -> "int"
; type : EXT_FLOOD_FILL_TYPE -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdi32 = windows.NewLazySystemDLL("GDI32.dll")
	procExtFloodFill = gdi32.NewProc("ExtFloodFill")
)

// hdc (HDC), x (INT), y (INT), color (COLORREF), type (EXT_FLOOD_FILL_TYPE)
r1, _, err := procExtFloodFill.Call(
	uintptr(hdc),
	uintptr(x),
	uintptr(y),
	uintptr(color),
	uintptr(type),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function ExtFloodFill(
  hdc: THandle;   // HDC
  x: Integer;   // INT
  y: Integer;   // INT
  color: DWORD;   // COLORREF
  type: DWORD   // EXT_FLOOD_FILL_TYPE
): BOOL; stdcall;
  external 'GDI32.dll' name 'ExtFloodFill';
result := DllCall("GDI32\ExtFloodFill"
    , "Ptr", hdc   ; HDC
    , "Int", x   ; INT
    , "Int", y   ; INT
    , "UInt", color   ; COLORREF
    , "UInt", type   ; EXT_FLOOD_FILL_TYPE
    , "Int")   ; return: BOOL
●ExtFloodFill(hdc, x, y, color, type) = DLL("GDI32.dll", "bool ExtFloodFill(void*, int, int, dword, dword)")
# 呼び出し: ExtFloodFill(hdc, x, y, color, type)
# hdc : HDC -> "void*"
# x : INT -> "int"
# y : INT -> "int"
# color : COLORREF -> "dword"
# type : EXT_FLOOD_FILL_TYPE -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。