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