ホーム › Graphics.GdiPlus › GdipDrawCachedBitmap
GdipDrawCachedBitmap
関数キャッシュ済みビットマップを指定位置に描画する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipDrawCachedBitmap(
GpGraphics* graphics,
GpCachedBitmap* cachedBitmap,
INT x,
INT y
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| graphics | GpGraphics* | inout |
| cachedBitmap | GpCachedBitmap* | inout |
| x | INT | in |
| y | INT | in |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipDrawCachedBitmap(
GpGraphics* graphics,
GpCachedBitmap* cachedBitmap,
INT x,
INT y
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipDrawCachedBitmap(
IntPtr graphics, // GpGraphics* in/out
IntPtr cachedBitmap, // GpCachedBitmap* in/out
int x, // INT
int y // INT
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipDrawCachedBitmap(
graphics As IntPtr, ' GpGraphics* in/out
cachedBitmap As IntPtr, ' GpCachedBitmap* in/out
x As Integer, ' INT
y As Integer ' INT
) As Integer
End Function' graphics : GpGraphics* in/out
' cachedBitmap : GpCachedBitmap* in/out
' x : INT
' y : INT
Declare PtrSafe Function GdipDrawCachedBitmap Lib "gdiplus" ( _
ByVal graphics As LongPtr, _
ByVal cachedBitmap As LongPtr, _
ByVal x As Long, _
ByVal y As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipDrawCachedBitmap = ctypes.windll.gdiplus.GdipDrawCachedBitmap
GdipDrawCachedBitmap.restype = ctypes.c_int
GdipDrawCachedBitmap.argtypes = [
ctypes.c_void_p, # graphics : GpGraphics* in/out
ctypes.c_void_p, # cachedBitmap : GpCachedBitmap* in/out
ctypes.c_int, # x : INT
ctypes.c_int, # y : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipDrawCachedBitmap = Fiddle::Function.new(
lib['GdipDrawCachedBitmap'],
[
Fiddle::TYPE_VOIDP, # graphics : GpGraphics* in/out
Fiddle::TYPE_VOIDP, # cachedBitmap : GpCachedBitmap* in/out
Fiddle::TYPE_INT, # x : INT
Fiddle::TYPE_INT, # y : INT
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipDrawCachedBitmap(
graphics: *mut GpGraphics, // GpGraphics* in/out
cachedBitmap: *mut GpCachedBitmap, // GpCachedBitmap* in/out
x: i32, // INT
y: i32 // INT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipDrawCachedBitmap(IntPtr graphics, IntPtr cachedBitmap, int x, int y);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipDrawCachedBitmap' -Namespace Win32 -PassThru
# $api::GdipDrawCachedBitmap(graphics, cachedBitmap, x, y)#uselib "gdiplus.dll"
#func global GdipDrawCachedBitmap "GdipDrawCachedBitmap" sptr, sptr, sptr, sptr
; GdipDrawCachedBitmap varptr(graphics), varptr(cachedBitmap), x, y ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; cachedBitmap : GpCachedBitmap* in/out -> "sptr"
; x : INT -> "sptr"
; y : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipDrawCachedBitmap "GdipDrawCachedBitmap" var, var, int, int ; res = GdipDrawCachedBitmap(graphics, cachedBitmap, x, y) ; graphics : GpGraphics* in/out -> "var" ; cachedBitmap : GpCachedBitmap* in/out -> "var" ; x : INT -> "int" ; y : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipDrawCachedBitmap "GdipDrawCachedBitmap" sptr, sptr, int, int ; res = GdipDrawCachedBitmap(varptr(graphics), varptr(cachedBitmap), x, y) ; graphics : GpGraphics* in/out -> "sptr" ; cachedBitmap : GpCachedBitmap* in/out -> "sptr" ; x : INT -> "int" ; y : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipDrawCachedBitmap(GpGraphics* graphics, GpCachedBitmap* cachedBitmap, INT x, INT y) #uselib "gdiplus.dll" #cfunc global GdipDrawCachedBitmap "GdipDrawCachedBitmap" var, var, int, int ; res = GdipDrawCachedBitmap(graphics, cachedBitmap, x, y) ; graphics : GpGraphics* in/out -> "var" ; cachedBitmap : GpCachedBitmap* in/out -> "var" ; x : INT -> "int" ; y : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipDrawCachedBitmap(GpGraphics* graphics, GpCachedBitmap* cachedBitmap, INT x, INT y) #uselib "gdiplus.dll" #cfunc global GdipDrawCachedBitmap "GdipDrawCachedBitmap" intptr, intptr, int, int ; res = GdipDrawCachedBitmap(varptr(graphics), varptr(cachedBitmap), x, y) ; graphics : GpGraphics* in/out -> "intptr" ; cachedBitmap : GpCachedBitmap* in/out -> "intptr" ; x : INT -> "int" ; y : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipDrawCachedBitmap = gdiplus.NewProc("GdipDrawCachedBitmap")
)
// graphics (GpGraphics* in/out), cachedBitmap (GpCachedBitmap* in/out), x (INT), y (INT)
r1, _, err := procGdipDrawCachedBitmap.Call(
uintptr(graphics),
uintptr(cachedBitmap),
uintptr(x),
uintptr(y),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipDrawCachedBitmap(
graphics: Pointer; // GpGraphics* in/out
cachedBitmap: Pointer; // GpCachedBitmap* in/out
x: Integer; // INT
y: Integer // INT
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipDrawCachedBitmap';result := DllCall("gdiplus\GdipDrawCachedBitmap"
, "Ptr", graphics ; GpGraphics* in/out
, "Ptr", cachedBitmap ; GpCachedBitmap* in/out
, "Int", x ; INT
, "Int", y ; INT
, "Int") ; return: Status●GdipDrawCachedBitmap(graphics, cachedBitmap, x, y) = DLL("gdiplus.dll", "int GdipDrawCachedBitmap(void*, void*, int, int)")
# 呼び出し: GdipDrawCachedBitmap(graphics, cachedBitmap, x, y)
# graphics : GpGraphics* in/out -> "void*"
# cachedBitmap : GpCachedBitmap* in/out -> "void*"
# x : INT -> "int"
# y : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。