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

GdipSetImageAttributesRemapTable

関数
画像属性に色を置換するリマップテーブルを設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetImageAttributesRemapTable(
    GpImageAttributes* imageattr,
    ColorAdjustType type,
    BOOL enableFlag,
    DWORD mapSize,
    const ColorMap* map
);

パラメーター

名前方向
imageattrGpImageAttributes*inout
typeColorAdjustTypein
enableFlagBOOLin
mapSizeDWORDin
mapColorMap*in

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipSetImageAttributesRemapTable = ctypes.windll.gdiplus.GdipSetImageAttributesRemapTable
GdipSetImageAttributesRemapTable.restype = ctypes.c_int
GdipSetImageAttributesRemapTable.argtypes = [
    ctypes.c_void_p,  # imageattr : GpImageAttributes* in/out
    ctypes.c_int,  # type : ColorAdjustType
    wintypes.BOOL,  # enableFlag : BOOL
    wintypes.DWORD,  # mapSize : DWORD
    ctypes.c_void_p,  # map : ColorMap*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetImageAttributesRemapTable = gdiplus.NewProc("GdipSetImageAttributesRemapTable")
)

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