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