Win32 API 日本語リファレンス
ホームGraphics.GdiPlus › GdipCreateImageAttributes

GdipCreateImageAttributes

関数
イメージ属性オブジェクトを新規作成する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipCreateImageAttributes(
    GpImageAttributes** imageattr
);

パラメーター

名前方向
imageattrGpImageAttributes**inout

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipCreateImageAttributes(
    GpImageAttributes** imageattr
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipCreateImageAttributes(
    IntPtr imageattr   // GpImageAttributes** in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipCreateImageAttributes(
    imageattr As IntPtr   ' GpImageAttributes** in/out
) As Integer
End Function
' imageattr : GpImageAttributes** in/out
Declare PtrSafe Function GdipCreateImageAttributes Lib "gdiplus" ( _
    ByVal imageattr As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipCreateImageAttributes = ctypes.windll.gdiplus.GdipCreateImageAttributes
GdipCreateImageAttributes.restype = ctypes.c_int
GdipCreateImageAttributes.argtypes = [
    ctypes.c_void_p,  # imageattr : GpImageAttributes** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipCreateImageAttributes = Fiddle::Function.new(
  lib['GdipCreateImageAttributes'],
  [
    Fiddle::TYPE_VOIDP,  # imageattr : GpImageAttributes** in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipCreateImageAttributes(
        imageattr: *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 GdipCreateImageAttributes(IntPtr imageattr);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipCreateImageAttributes' -Namespace Win32 -PassThru
# $api::GdipCreateImageAttributes(imageattr)
#uselib "gdiplus.dll"
#func global GdipCreateImageAttributes "GdipCreateImageAttributes" sptr
; GdipCreateImageAttributes varptr(imageattr)   ; 戻り値は stat
; imageattr : GpImageAttributes** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipCreateImageAttributes "GdipCreateImageAttributes" var
; res = GdipCreateImageAttributes(imageattr)
; imageattr : GpImageAttributes** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipCreateImageAttributes(GpImageAttributes** imageattr)
#uselib "gdiplus.dll"
#cfunc global GdipCreateImageAttributes "GdipCreateImageAttributes" var
; res = GdipCreateImageAttributes(imageattr)
; imageattr : GpImageAttributes** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipCreateImageAttributes = gdiplus.NewProc("GdipCreateImageAttributes")
)

// imageattr (GpImageAttributes** in/out)
r1, _, err := procGdipCreateImageAttributes.Call(
	uintptr(imageattr),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipCreateImageAttributes(
  imageattr: Pointer   // GpImageAttributes** in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipCreateImageAttributes';
result := DllCall("gdiplus\GdipCreateImageAttributes"
    , "Ptr", imageattr   ; GpImageAttributes** in/out
    , "Int")   ; return: Status
●GdipCreateImageAttributes(imageattr) = DLL("gdiplus.dll", "int GdipCreateImageAttributes(void*)")
# 呼び出し: GdipCreateImageAttributes(imageattr)
# imageattr : GpImageAttributes** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。