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

GdipCreateTextureIA

関数
画像属性を指定して領域からテクスチャブラシを作成する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipCreateTextureIA(
    GpImage* image,
    const GpImageAttributes* imageAttributes,
    FLOAT x,
    FLOAT y,
    FLOAT width,
    FLOAT height,
    GpTexture** texture
);

パラメーター

名前方向
imageGpImage*inout
imageAttributesGpImageAttributes*in
xFLOATin
yFLOATin
widthFLOATin
heightFLOATin
textureGpTexture**inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipCreateTextureIA = ctypes.windll.gdiplus.GdipCreateTextureIA
GdipCreateTextureIA.restype = ctypes.c_int
GdipCreateTextureIA.argtypes = [
    ctypes.c_void_p,  # image : GpImage* in/out
    ctypes.c_void_p,  # imageAttributes : GpImageAttributes*
    ctypes.c_float,  # x : FLOAT
    ctypes.c_float,  # y : FLOAT
    ctypes.c_float,  # width : FLOAT
    ctypes.c_float,  # height : FLOAT
    ctypes.c_void_p,  # texture : GpTexture** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipCreateTextureIA = Fiddle::Function.new(
  lib['GdipCreateTextureIA'],
  [
    Fiddle::TYPE_VOIDP,  # image : GpImage* in/out
    Fiddle::TYPE_VOIDP,  # imageAttributes : GpImageAttributes*
    Fiddle::TYPE_FLOAT,  # x : FLOAT
    Fiddle::TYPE_FLOAT,  # y : FLOAT
    Fiddle::TYPE_FLOAT,  # width : FLOAT
    Fiddle::TYPE_FLOAT,  # height : FLOAT
    Fiddle::TYPE_VOIDP,  # texture : GpTexture** in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipCreateTextureIA(
        image: *mut GpImage,  // GpImage* in/out
        imageAttributes: *const GpImageAttributes,  // GpImageAttributes*
        x: f32,  // FLOAT
        y: f32,  // FLOAT
        width: f32,  // FLOAT
        height: f32,  // FLOAT
        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 GdipCreateTextureIA(IntPtr image, IntPtr imageAttributes, float x, float y, float width, float height, IntPtr texture);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipCreateTextureIA' -Namespace Win32 -PassThru
# $api::GdipCreateTextureIA(image, imageAttributes, x, y, width, height, texture)
#uselib "gdiplus.dll"
#func global GdipCreateTextureIA "GdipCreateTextureIA" sptr, sptr, float, float, float, float, sptr
; GdipCreateTextureIA varptr(image), varptr(imageAttributes), x, y, width, height, varptr(texture)   ; 戻り値は stat
; image : GpImage* in/out -> "sptr"
; imageAttributes : GpImageAttributes* -> "sptr"
; x : FLOAT -> "float"
; y : FLOAT -> "float"
; width : FLOAT -> "float"
; height : FLOAT -> "float"
; texture : GpTexture** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipCreateTextureIA "GdipCreateTextureIA" var, var, float, float, float, float, var
; res = GdipCreateTextureIA(image, imageAttributes, x, y, width, height, texture)
; image : GpImage* in/out -> "var"
; imageAttributes : GpImageAttributes* -> "var"
; x : FLOAT -> "float"
; y : FLOAT -> "float"
; width : FLOAT -> "float"
; height : FLOAT -> "float"
; texture : GpTexture** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipCreateTextureIA(GpImage* image, GpImageAttributes* imageAttributes, FLOAT x, FLOAT y, FLOAT width, FLOAT height, GpTexture** texture)
#uselib "gdiplus.dll"
#cfunc global GdipCreateTextureIA "GdipCreateTextureIA" var, var, float, float, float, float, var
; res = GdipCreateTextureIA(image, imageAttributes, x, y, width, height, texture)
; image : GpImage* in/out -> "var"
; imageAttributes : GpImageAttributes* -> "var"
; x : FLOAT -> "float"
; y : FLOAT -> "float"
; width : FLOAT -> "float"
; height : FLOAT -> "float"
; texture : GpTexture** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipCreateTextureIA = gdiplus.NewProc("GdipCreateTextureIA")
)

// image (GpImage* in/out), imageAttributes (GpImageAttributes*), x (FLOAT), y (FLOAT), width (FLOAT), height (FLOAT), texture (GpTexture** in/out)
r1, _, err := procGdipCreateTextureIA.Call(
	uintptr(image),
	uintptr(imageAttributes),
	uintptr(math.Float32bits(x)),
	uintptr(math.Float32bits(y)),
	uintptr(math.Float32bits(width)),
	uintptr(math.Float32bits(height)),
	uintptr(texture),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。
function GdipCreateTextureIA(
  image: Pointer;   // GpImage* in/out
  imageAttributes: Pointer;   // GpImageAttributes*
  x: Single;   // FLOAT
  y: Single;   // FLOAT
  width: Single;   // FLOAT
  height: Single;   // FLOAT
  texture: Pointer   // GpTexture** in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipCreateTextureIA';
result := DllCall("gdiplus\GdipCreateTextureIA"
    , "Ptr", image   ; GpImage* in/out
    , "Ptr", imageAttributes   ; GpImageAttributes*
    , "Float", x   ; FLOAT
    , "Float", y   ; FLOAT
    , "Float", width   ; FLOAT
    , "Float", height   ; FLOAT
    , "Ptr", texture   ; GpTexture** in/out
    , "Int")   ; return: Status
●GdipCreateTextureIA(image, imageAttributes, x, y, width, height, texture) = DLL("gdiplus.dll", "int GdipCreateTextureIA(void*, void*, float, float, float, float, void*)")
# 呼び出し: GdipCreateTextureIA(image, imageAttributes, x, y, width, height, texture)
# image : GpImage* in/out -> "void*"
# imageAttributes : GpImageAttributes* -> "void*"
# x : FLOAT -> "float"
# y : FLOAT -> "float"
# width : FLOAT -> "float"
# height : FLOAT -> "float"
# texture : GpTexture** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。