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

GdipCreateTexture2I

関数
画像の整数領域からテクスチャブラシを作成する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipCreateTexture2I(
    GpImage* image,
    WrapMode wrapmode,
    INT x,
    INT y,
    INT width,
    INT height,
    GpTexture** texture
);

パラメーター

名前方向
imageGpImage*inout
wrapmodeWrapModein
xINTin
yINTin
widthINTin
heightINTin
textureGpTexture**inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipCreateTexture2I = ctypes.windll.gdiplus.GdipCreateTexture2I
GdipCreateTexture2I.restype = ctypes.c_int
GdipCreateTexture2I.argtypes = [
    ctypes.c_void_p,  # image : GpImage* in/out
    ctypes.c_int,  # wrapmode : WrapMode
    ctypes.c_int,  # x : INT
    ctypes.c_int,  # y : INT
    ctypes.c_int,  # width : INT
    ctypes.c_int,  # height : INT
    ctypes.c_void_p,  # texture : GpTexture** in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipCreateTexture2I = gdiplus.NewProc("GdipCreateTexture2I")
)

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