ホーム › Graphics.Gdi › RectVisible
RectVisible
関数指定矩形がクリッピング領域内にあるか判定する。
シグネチャ
// GDI32.dll
#include <windows.h>
BOOL RectVisible(
HDC hdc,
const RECT* lprect
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hdc | HDC | in |
| lprect | RECT* | in |
戻り値の型: BOOL
各言語での呼び出し定義
// GDI32.dll
#include <windows.h>
BOOL RectVisible(
HDC hdc,
const RECT* lprect
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern bool RectVisible(
IntPtr hdc, // HDC
IntPtr lprect // RECT*
);<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function RectVisible(
hdc As IntPtr, ' HDC
lprect As IntPtr ' RECT*
) As Boolean
End Function' hdc : HDC
' lprect : RECT*
Declare PtrSafe Function RectVisible Lib "gdi32" ( _
ByVal hdc As LongPtr, _
ByVal lprect As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RectVisible = ctypes.windll.gdi32.RectVisible
RectVisible.restype = wintypes.BOOL
RectVisible.argtypes = [
wintypes.HANDLE, # hdc : HDC
ctypes.c_void_p, # lprect : RECT*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
RectVisible = Fiddle::Function.new(
lib['RectVisible'],
[
Fiddle::TYPE_VOIDP, # hdc : HDC
Fiddle::TYPE_VOIDP, # lprect : RECT*
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn RectVisible(
hdc: *mut core::ffi::c_void, // HDC
lprect: *const RECT // RECT*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll")]
public static extern bool RectVisible(IntPtr hdc, IntPtr lprect);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_RectVisible' -Namespace Win32 -PassThru
# $api::RectVisible(hdc, lprect)#uselib "GDI32.dll"
#func global RectVisible "RectVisible" sptr, sptr
; RectVisible hdc, varptr(lprect) ; 戻り値は stat
; hdc : HDC -> "sptr"
; lprect : RECT* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "GDI32.dll" #cfunc global RectVisible "RectVisible" sptr, var ; res = RectVisible(hdc, lprect) ; hdc : HDC -> "sptr" ; lprect : RECT* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "GDI32.dll" #cfunc global RectVisible "RectVisible" sptr, sptr ; res = RectVisible(hdc, varptr(lprect)) ; hdc : HDC -> "sptr" ; lprect : RECT* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL RectVisible(HDC hdc, RECT* lprect) #uselib "GDI32.dll" #cfunc global RectVisible "RectVisible" intptr, var ; res = RectVisible(hdc, lprect) ; hdc : HDC -> "intptr" ; lprect : RECT* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL RectVisible(HDC hdc, RECT* lprect) #uselib "GDI32.dll" #cfunc global RectVisible "RectVisible" intptr, intptr ; res = RectVisible(hdc, varptr(lprect)) ; hdc : HDC -> "intptr" ; lprect : RECT* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procRectVisible = gdi32.NewProc("RectVisible")
)
// hdc (HDC), lprect (RECT*)
r1, _, err := procRectVisible.Call(
uintptr(hdc),
uintptr(lprect),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction RectVisible(
hdc: THandle; // HDC
lprect: Pointer // RECT*
): BOOL; stdcall;
external 'GDI32.dll' name 'RectVisible';result := DllCall("GDI32\RectVisible"
, "Ptr", hdc ; HDC
, "Ptr", lprect ; RECT*
, "Int") ; return: BOOL●RectVisible(hdc, lprect) = DLL("GDI32.dll", "bool RectVisible(void*, void*)")
# 呼び出し: RectVisible(hdc, lprect)
# hdc : HDC -> "void*"
# lprect : RECT* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。