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

GdipSetImageAttributesOutputChannelColorProfile

関数
画像属性に出力チャンネル用のカラープロファイルを設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetImageAttributesOutputChannelColorProfile(
    GpImageAttributes* imageattr,
    ColorAdjustType type,
    BOOL enableFlag,
    LPCWSTR colorProfileFilename
);

パラメーター

名前方向
imageattrGpImageAttributes*inout
typeColorAdjustTypein
enableFlagBOOLin
colorProfileFilenameLPCWSTRin

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipSetImageAttributesOutputChannelColorProfile = ctypes.windll.gdiplus.GdipSetImageAttributesOutputChannelColorProfile
GdipSetImageAttributesOutputChannelColorProfile.restype = ctypes.c_int
GdipSetImageAttributesOutputChannelColorProfile.argtypes = [
    ctypes.c_void_p,  # imageattr : GpImageAttributes* in/out
    ctypes.c_int,  # type : ColorAdjustType
    wintypes.BOOL,  # enableFlag : BOOL
    wintypes.LPCWSTR,  # colorProfileFilename : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetImageAttributesOutputChannelColorProfile = gdiplus.NewProc("GdipSetImageAttributesOutputChannelColorProfile")
)

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