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

GdipSetPropertyItem

関数
イメージにメタデータプロパティ項目を設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetPropertyItem(
    GpImage* image,
    const PropertyItem* item
);

パラメーター

名前方向
imageGpImage*inout
itemPropertyItem*in

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipSetPropertyItem = ctypes.windll.gdiplus.GdipSetPropertyItem
GdipSetPropertyItem.restype = ctypes.c_int
GdipSetPropertyItem.argtypes = [
    ctypes.c_void_p,  # image : GpImage* in/out
    ctypes.c_void_p,  # item : PropertyItem*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipSetPropertyItem = Fiddle::Function.new(
  lib['GdipSetPropertyItem'],
  [
    Fiddle::TYPE_VOIDP,  # image : GpImage* in/out
    Fiddle::TYPE_VOIDP,  # item : PropertyItem*
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipSetPropertyItem(
        image: *mut GpImage,  // GpImage* in/out
        item: *const PropertyItem  // PropertyItem*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipSetPropertyItem(IntPtr image, IntPtr item);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipSetPropertyItem' -Namespace Win32 -PassThru
# $api::GdipSetPropertyItem(image, item)
#uselib "gdiplus.dll"
#func global GdipSetPropertyItem "GdipSetPropertyItem" sptr, sptr
; GdipSetPropertyItem varptr(image), varptr(item)   ; 戻り値は stat
; image : GpImage* in/out -> "sptr"
; item : PropertyItem* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipSetPropertyItem "GdipSetPropertyItem" var, var
; res = GdipSetPropertyItem(image, item)
; image : GpImage* in/out -> "var"
; item : PropertyItem* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipSetPropertyItem(GpImage* image, PropertyItem* item)
#uselib "gdiplus.dll"
#cfunc global GdipSetPropertyItem "GdipSetPropertyItem" var, var
; res = GdipSetPropertyItem(image, item)
; image : GpImage* in/out -> "var"
; item : PropertyItem* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetPropertyItem = gdiplus.NewProc("GdipSetPropertyItem")
)

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