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