ホーム › Graphics.GdiPlus › GdipIsOutlineVisiblePathPoint
GdipIsOutlineVisiblePathPoint
関数指定した点がGDI+パスの輪郭上にあるか判定する(浮動小数点版)。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipIsOutlineVisiblePathPoint(
GpPath* path,
FLOAT x,
FLOAT y,
GpPen* pen,
GpGraphics* graphics,
BOOL* result
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| path | GpPath* | inout |
| x | FLOAT | in |
| y | FLOAT | in |
| pen | GpPen* | inout |
| graphics | GpGraphics* | inout |
| result | BOOL* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipIsOutlineVisiblePathPoint(
GpPath* path,
FLOAT x,
FLOAT y,
GpPen* pen,
GpGraphics* graphics,
BOOL* result
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipIsOutlineVisiblePathPoint(
IntPtr path, // GpPath* in/out
float x, // FLOAT
float y, // FLOAT
IntPtr pen, // GpPen* in/out
IntPtr graphics, // GpGraphics* in/out
ref int result // BOOL* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipIsOutlineVisiblePathPoint(
path As IntPtr, ' GpPath* in/out
x As Single, ' FLOAT
y As Single, ' FLOAT
pen As IntPtr, ' GpPen* in/out
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
' pen : GpPen* in/out
' graphics : GpGraphics* in/out
' result : BOOL* in/out
Declare PtrSafe Function GdipIsOutlineVisiblePathPoint Lib "gdiplus" ( _
ByVal path As LongPtr, _
ByVal x As Single, _
ByVal y As Single, _
ByVal pen As LongPtr, _
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
GdipIsOutlineVisiblePathPoint = ctypes.windll.gdiplus.GdipIsOutlineVisiblePathPoint
GdipIsOutlineVisiblePathPoint.restype = ctypes.c_int
GdipIsOutlineVisiblePathPoint.argtypes = [
ctypes.c_void_p, # path : GpPath* in/out
ctypes.c_float, # x : FLOAT
ctypes.c_float, # y : FLOAT
ctypes.c_void_p, # pen : GpPen* in/out
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')
GdipIsOutlineVisiblePathPoint = Fiddle::Function.new(
lib['GdipIsOutlineVisiblePathPoint'],
[
Fiddle::TYPE_VOIDP, # path : GpPath* in/out
Fiddle::TYPE_FLOAT, # x : FLOAT
Fiddle::TYPE_FLOAT, # y : FLOAT
Fiddle::TYPE_VOIDP, # pen : GpPen* in/out
Fiddle::TYPE_VOIDP, # graphics : GpGraphics* in/out
Fiddle::TYPE_VOIDP, # result : BOOL* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipIsOutlineVisiblePathPoint(
path: *mut GpPath, // GpPath* in/out
x: f32, // FLOAT
y: f32, // FLOAT
pen: *mut GpPen, // GpPen* in/out
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 GdipIsOutlineVisiblePathPoint(IntPtr path, float x, float y, IntPtr pen, IntPtr graphics, ref int result);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipIsOutlineVisiblePathPoint' -Namespace Win32 -PassThru
# $api::GdipIsOutlineVisiblePathPoint(path, x, y, pen, graphics, result)#uselib "gdiplus.dll"
#func global GdipIsOutlineVisiblePathPoint "GdipIsOutlineVisiblePathPoint" sptr, float, float, sptr, sptr, sptr
; GdipIsOutlineVisiblePathPoint varptr(path), x, y, varptr(pen), varptr(graphics), result ; 戻り値は stat
; path : GpPath* in/out -> "sptr"
; x : FLOAT -> "float"
; y : FLOAT -> "float"
; pen : GpPen* in/out -> "sptr"
; graphics : GpGraphics* in/out -> "sptr"
; result : BOOL* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipIsOutlineVisiblePathPoint "GdipIsOutlineVisiblePathPoint" var, float, float, var, var, int ; res = GdipIsOutlineVisiblePathPoint(path, x, y, pen, graphics, result) ; path : GpPath* in/out -> "var" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; pen : GpPen* in/out -> "var" ; graphics : GpGraphics* in/out -> "var" ; result : BOOL* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipIsOutlineVisiblePathPoint "GdipIsOutlineVisiblePathPoint" sptr, float, float, sptr, sptr, int ; res = GdipIsOutlineVisiblePathPoint(varptr(path), x, y, varptr(pen), varptr(graphics), result) ; path : GpPath* in/out -> "sptr" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; pen : GpPen* in/out -> "sptr" ; graphics : GpGraphics* in/out -> "sptr" ; result : BOOL* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipIsOutlineVisiblePathPoint(GpPath* path, FLOAT x, FLOAT y, GpPen* pen, GpGraphics* graphics, BOOL* result) #uselib "gdiplus.dll" #cfunc global GdipIsOutlineVisiblePathPoint "GdipIsOutlineVisiblePathPoint" var, float, float, var, var, int ; res = GdipIsOutlineVisiblePathPoint(path, x, y, pen, graphics, result) ; path : GpPath* in/out -> "var" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; pen : GpPen* in/out -> "var" ; graphics : GpGraphics* in/out -> "var" ; result : BOOL* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipIsOutlineVisiblePathPoint(GpPath* path, FLOAT x, FLOAT y, GpPen* pen, GpGraphics* graphics, BOOL* result) #uselib "gdiplus.dll" #cfunc global GdipIsOutlineVisiblePathPoint "GdipIsOutlineVisiblePathPoint" intptr, float, float, intptr, intptr, int ; res = GdipIsOutlineVisiblePathPoint(varptr(path), x, y, varptr(pen), varptr(graphics), result) ; path : GpPath* in/out -> "intptr" ; x : FLOAT -> "float" ; y : FLOAT -> "float" ; pen : GpPen* in/out -> "intptr" ; 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")
procGdipIsOutlineVisiblePathPoint = gdiplus.NewProc("GdipIsOutlineVisiblePathPoint")
)
// path (GpPath* in/out), x (FLOAT), y (FLOAT), pen (GpPen* in/out), graphics (GpGraphics* in/out), result (BOOL* in/out)
r1, _, err := procGdipIsOutlineVisiblePathPoint.Call(
uintptr(path),
uintptr(math.Float32bits(x)),
uintptr(math.Float32bits(y)),
uintptr(pen),
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 GdipIsOutlineVisiblePathPoint(
path: Pointer; // GpPath* in/out
x: Single; // FLOAT
y: Single; // FLOAT
pen: Pointer; // GpPen* in/out
graphics: Pointer; // GpGraphics* in/out
result: Pointer // BOOL* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipIsOutlineVisiblePathPoint';result := DllCall("gdiplus\GdipIsOutlineVisiblePathPoint"
, "Ptr", path ; GpPath* in/out
, "Float", x ; FLOAT
, "Float", y ; FLOAT
, "Ptr", pen ; GpPen* in/out
, "Ptr", graphics ; GpGraphics* in/out
, "Ptr", result ; BOOL* in/out
, "Int") ; return: Status●GdipIsOutlineVisiblePathPoint(path, x, y, pen, graphics, result) = DLL("gdiplus.dll", "int GdipIsOutlineVisiblePathPoint(void*, float, float, void*, void*, void*)")
# 呼び出し: GdipIsOutlineVisiblePathPoint(path, x, y, pen, graphics, result)
# path : GpPath* in/out -> "void*"
# x : FLOAT -> "float"
# y : FLOAT -> "float"
# pen : GpPen* in/out -> "void*"
# graphics : GpGraphics* in/out -> "void*"
# result : BOOL* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。