ホーム › Graphics.GdiPlus › GdipIsVisiblePathPoint
GdipIsVisiblePathPoint
関数指定した点がGDI+パスの内部に含まれるか判定する(浮動小数点版)。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipIsVisiblePathPoint(
GpPath* path,
FLOAT x,
FLOAT y,
GpGraphics* graphics,
BOOL* result
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| path | GpPath* | inout |
| x | FLOAT | in |
| y | FLOAT | in |
| graphics | GpGraphics* | inout |
| result | BOOL* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipIsVisiblePathPoint(
GpPath* path,
FLOAT x,
FLOAT y,
GpGraphics* graphics,
BOOL* result
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipIsVisiblePathPoint(
IntPtr path, // GpPath* in/out
float x, // FLOAT
float y, // FLOAT
IntPtr graphics, // GpGraphics* in/out
ref int result // BOOL* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipIsVisiblePathPoint(
path As IntPtr, ' GpPath* in/out
x As Single, ' FLOAT
y As Single, ' FLOAT
graphics As IntPtr, ' GpGraphics* in/out
ByRef result As Integer ' BOOL* in/out
) As Integer
End Function' path : GpPath* in/out
' x : FLOAT
' y : FLOAT
' graphics : GpGraphics* in/out
' result : BOOL* in/out
Declare PtrSafe Function GdipIsVisiblePathPoint Lib "gdiplus" ( _
ByVal path As LongPtr, _
ByVal x As Single, _
ByVal y As Single, _
ByVal graphics As LongPtr, _
ByRef result As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipIsVisiblePathPoint = ctypes.windll.gdiplus.GdipIsVisiblePathPoint
GdipIsVisiblePathPoint.restype = ctypes.c_int
GdipIsVisiblePathPoint.argtypes = [
ctypes.c_void_p, # path : GpPath* in/out
ctypes.c_float, # x : FLOAT
ctypes.c_float, # y : FLOAT
ctypes.c_void_p, # graphics : GpGraphics* in/out
ctypes.c_void_p, # result : BOOL* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipIsVisiblePathPoint = Fiddle::Function.new(
lib['GdipIsVisiblePathPoint'],
[
Fiddle::TYPE_VOIDP, # path : GpPath* in/out
Fiddle::TYPE_FLOAT, # x : FLOAT
Fiddle::TYPE_FLOAT, # y : FLOAT
Fiddle::TYPE_VOIDP, # graphics : GpGraphics* in/out
Fiddle::TYPE_VOIDP, # result : BOOL* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipIsVisiblePathPoint(
path: *mut GpPath, // GpPath* in/out
x: f32, // FLOAT
y: f32, // FLOAT
graphics: *mut GpGraphics, // GpGraphics* in/out
result: *mut i32 // BOOL* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipIsVisiblePathPoint(IntPtr path, float x, float y, IntPtr graphics, ref int result);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipIsVisiblePathPoint' -Namespace Win32 -PassThru
# $api::GdipIsVisiblePathPoint(path, x, y, graphics, result)#uselib "gdiplus.dll"
#func global GdipIsVisiblePathPoint "GdipIsVisiblePathPoint" sptr, float, float, sptr, sptr
; GdipIsVisiblePathPoint varptr(path), x, y, varptr(graphics), result ; 戻り値は stat
; path : GpPath* in/out -> "sptr"
; x : FLOAT -> "float"
; y : FLOAT -> "float"
; graphics : GpGraphics* in/out -> "sptr"
; result : BOOL* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipIsVisiblePathPoint "GdipIsVisiblePathPoint" var, float, float, var, int ; res = GdipIsVisiblePathPoint(path, x, y, graphics, result) ; path : GpPath* in/out -> "var" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; graphics : GpGraphics* in/out -> "var" ; result : BOOL* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipIsVisiblePathPoint "GdipIsVisiblePathPoint" sptr, float, float, sptr, int ; res = GdipIsVisiblePathPoint(varptr(path), x, y, varptr(graphics), result) ; path : GpPath* in/out -> "sptr" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; graphics : GpGraphics* in/out -> "sptr" ; result : BOOL* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipIsVisiblePathPoint(GpPath* path, FLOAT x, FLOAT y, GpGraphics* graphics, BOOL* result) #uselib "gdiplus.dll" #cfunc global GdipIsVisiblePathPoint "GdipIsVisiblePathPoint" var, float, float, var, int ; res = GdipIsVisiblePathPoint(path, x, y, graphics, result) ; path : GpPath* in/out -> "var" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; graphics : GpGraphics* in/out -> "var" ; result : BOOL* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipIsVisiblePathPoint(GpPath* path, FLOAT x, FLOAT y, GpGraphics* graphics, BOOL* result) #uselib "gdiplus.dll" #cfunc global GdipIsVisiblePathPoint "GdipIsVisiblePathPoint" intptr, float, float, intptr, int ; res = GdipIsVisiblePathPoint(varptr(path), x, y, varptr(graphics), result) ; path : GpPath* in/out -> "intptr" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; graphics : GpGraphics* in/out -> "intptr" ; result : BOOL* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipIsVisiblePathPoint = gdiplus.NewProc("GdipIsVisiblePathPoint")
)
// path (GpPath* in/out), x (FLOAT), y (FLOAT), graphics (GpGraphics* in/out), result (BOOL* in/out)
r1, _, err := procGdipIsVisiblePathPoint.Call(
uintptr(path),
uintptr(math.Float32bits(x)),
uintptr(math.Float32bits(y)),
uintptr(graphics),
uintptr(result),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Status
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。function GdipIsVisiblePathPoint(
path: Pointer; // GpPath* in/out
x: Single; // FLOAT
y: Single; // FLOAT
graphics: Pointer; // GpGraphics* in/out
result: Pointer // BOOL* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipIsVisiblePathPoint';result := DllCall("gdiplus\GdipIsVisiblePathPoint"
, "Ptr", path ; GpPath* in/out
, "Float", x ; FLOAT
, "Float", y ; FLOAT
, "Ptr", graphics ; GpGraphics* in/out
, "Ptr", result ; BOOL* in/out
, "Int") ; return: Status●GdipIsVisiblePathPoint(path, x, y, graphics, result) = DLL("gdiplus.dll", "int GdipIsVisiblePathPoint(void*, float, float, void*, void*)")
# 呼び出し: GdipIsVisiblePathPoint(path, x, y, graphics, result)
# path : GpPath* in/out -> "void*"
# x : FLOAT -> "float"
# y : FLOAT -> "float"
# graphics : GpGraphics* in/out -> "void*"
# result : BOOL* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。