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

GdipSetImageAttributesWrapMode

関数
画像属性にタイル描画時のラップモードを設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetImageAttributesWrapMode(
    GpImageAttributes* imageAttr,
    WrapMode wrap,
    DWORD argb,
    BOOL clamp
);

パラメーター

名前方向
imageAttrGpImageAttributes*inout
wrapWrapModein
argbDWORDin
clampBOOLin

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipSetImageAttributesWrapMode = ctypes.windll.gdiplus.GdipSetImageAttributesWrapMode
GdipSetImageAttributesWrapMode.restype = ctypes.c_int
GdipSetImageAttributesWrapMode.argtypes = [
    ctypes.c_void_p,  # imageAttr : GpImageAttributes* in/out
    ctypes.c_int,  # wrap : WrapMode
    wintypes.DWORD,  # argb : DWORD
    wintypes.BOOL,  # clamp : BOOL
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetImageAttributesWrapMode = gdiplus.NewProc("GdipSetImageAttributesWrapMode")
)

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