ホーム › Graphics.GdiPlus › GdipCreateTextureIAI
GdipCreateTextureIAI
関数画像属性と整数領域からテクスチャブラシを作成する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipCreateTextureIAI(
GpImage* image,
const GpImageAttributes* imageAttributes,
INT x,
INT y,
INT width,
INT height,
GpTexture** texture
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| image | GpImage* | inout |
| imageAttributes | GpImageAttributes* | in |
| x | INT | in |
| y | INT | in |
| width | INT | in |
| height | INT | in |
| texture | GpTexture** | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipCreateTextureIAI(
GpImage* image,
const GpImageAttributes* imageAttributes,
INT x,
INT y,
INT width,
INT height,
GpTexture** texture
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipCreateTextureIAI(
IntPtr image, // GpImage* in/out
IntPtr imageAttributes, // GpImageAttributes*
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 GdipCreateTextureIAI(
image As IntPtr, ' GpImage* in/out
imageAttributes As IntPtr, ' GpImageAttributes*
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
' imageAttributes : GpImageAttributes*
' x : INT
' y : INT
' width : INT
' height : INT
' texture : GpTexture** in/out
Declare PtrSafe Function GdipCreateTextureIAI Lib "gdiplus" ( _
ByVal image As LongPtr, _
ByVal imageAttributes As LongPtr, _
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
GdipCreateTextureIAI = ctypes.windll.gdiplus.GdipCreateTextureIAI
GdipCreateTextureIAI.restype = ctypes.c_int
GdipCreateTextureIAI.argtypes = [
ctypes.c_void_p, # image : GpImage* in/out
ctypes.c_void_p, # imageAttributes : GpImageAttributes*
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')
GdipCreateTextureIAI = Fiddle::Function.new(
lib['GdipCreateTextureIAI'],
[
Fiddle::TYPE_VOIDP, # image : GpImage* in/out
Fiddle::TYPE_VOIDP, # imageAttributes : GpImageAttributes*
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 GdipCreateTextureIAI(
image: *mut GpImage, // GpImage* in/out
imageAttributes: *const GpImageAttributes, // GpImageAttributes*
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 GdipCreateTextureIAI(IntPtr image, IntPtr imageAttributes, int x, int y, int width, int height, IntPtr texture);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipCreateTextureIAI' -Namespace Win32 -PassThru
# $api::GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture)#uselib "gdiplus.dll"
#func global GdipCreateTextureIAI "GdipCreateTextureIAI" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; GdipCreateTextureIAI varptr(image), varptr(imageAttributes), x, y, width, height, varptr(texture) ; 戻り値は stat
; image : GpImage* in/out -> "sptr"
; imageAttributes : GpImageAttributes* -> "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 GdipCreateTextureIAI "GdipCreateTextureIAI" var, var, int, int, int, int, var ; res = GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture) ; image : GpImage* in/out -> "var" ; imageAttributes : GpImageAttributes* -> "var" ; x : INT -> "int" ; y : INT -> "int" ; width : INT -> "int" ; height : INT -> "int" ; texture : GpTexture** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipCreateTextureIAI "GdipCreateTextureIAI" sptr, sptr, int, int, int, int, sptr ; res = GdipCreateTextureIAI(varptr(image), varptr(imageAttributes), x, y, width, height, varptr(texture)) ; image : GpImage* in/out -> "sptr" ; imageAttributes : GpImageAttributes* -> "sptr" ; x : INT -> "int" ; y : INT -> "int" ; width : INT -> "int" ; height : INT -> "int" ; texture : GpTexture** in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipCreateTextureIAI(GpImage* image, GpImageAttributes* imageAttributes, INT x, INT y, INT width, INT height, GpTexture** texture) #uselib "gdiplus.dll" #cfunc global GdipCreateTextureIAI "GdipCreateTextureIAI" var, var, int, int, int, int, var ; res = GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture) ; image : GpImage* in/out -> "var" ; imageAttributes : GpImageAttributes* -> "var" ; x : INT -> "int" ; y : INT -> "int" ; width : INT -> "int" ; height : INT -> "int" ; texture : GpTexture** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipCreateTextureIAI(GpImage* image, GpImageAttributes* imageAttributes, INT x, INT y, INT width, INT height, GpTexture** texture) #uselib "gdiplus.dll" #cfunc global GdipCreateTextureIAI "GdipCreateTextureIAI" intptr, intptr, int, int, int, int, intptr ; res = GdipCreateTextureIAI(varptr(image), varptr(imageAttributes), x, y, width, height, varptr(texture)) ; image : GpImage* in/out -> "intptr" ; imageAttributes : GpImageAttributes* -> "intptr" ; x : INT -> "int" ; y : INT -> "int" ; width : INT -> "int" ; height : INT -> "int" ; texture : GpTexture** in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipCreateTextureIAI = gdiplus.NewProc("GdipCreateTextureIAI")
)
// image (GpImage* in/out), imageAttributes (GpImageAttributes*), x (INT), y (INT), width (INT), height (INT), texture (GpTexture** in/out)
r1, _, err := procGdipCreateTextureIAI.Call(
uintptr(image),
uintptr(imageAttributes),
uintptr(x),
uintptr(y),
uintptr(width),
uintptr(height),
uintptr(texture),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipCreateTextureIAI(
image: Pointer; // GpImage* in/out
imageAttributes: Pointer; // GpImageAttributes*
x: Integer; // INT
y: Integer; // INT
width: Integer; // INT
height: Integer; // INT
texture: Pointer // GpTexture** in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipCreateTextureIAI';result := DllCall("gdiplus\GdipCreateTextureIAI"
, "Ptr", image ; GpImage* in/out
, "Ptr", imageAttributes ; GpImageAttributes*
, "Int", x ; INT
, "Int", y ; INT
, "Int", width ; INT
, "Int", height ; INT
, "Ptr", texture ; GpTexture** in/out
, "Int") ; return: Status●GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture) = DLL("gdiplus.dll", "int GdipCreateTextureIAI(void*, void*, int, int, int, int, void*)")
# 呼び出し: GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture)
# image : GpImage* in/out -> "void*"
# imageAttributes : GpImageAttributes* -> "void*"
# 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)。