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