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

GdipCreateTextureIAI

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

シグネチャ

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

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

パラメーター

名前方向説明
imageGpImage*inoutテクスチャの元となる画像オブジェクトへのポインタ。
imageAttributesGpImageAttributes*in色補正やラップモードを指定する画像属性へのポインタ。NULL可。
xINTin使用する画像領域の左上X座標(整数)。
yINTin使用する画像領域の左上Y座標(整数)。
widthINTin使用する画像領域の幅(整数)。
heightINTin使用する画像領域の高さ(整数)。
textureGpTexture**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 方式にも切替可。
出力引数:
; 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 方式にも切替可。
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   // Status
function 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)。
const std = @import("std");

extern "gdiplus" fn GdipCreateTextureIAI(
    image: [*c]GpImage, // GpImage* in/out
    imageAttributes: [*c]GpImageAttributes, // GpImageAttributes*
    x: i32, // INT
    y: i32, // INT
    width: i32, // INT
    height: i32, // INT
    texture: [*c][*c]GpTexture // GpTexture** in/out
) callconv(std.os.windows.WINAPI) i32;
proc GdipCreateTextureIAI(
    image: ptr GpImage,  # GpImage* in/out
    imageAttributes: ptr GpImageAttributes,  # GpImageAttributes*
    x: int32,  # INT
    y: int32,  # INT
    width: int32,  # INT
    height: int32,  # INT
    texture: ptr GpTexture  # GpTexture** in/out
): int32 {.importc: "GdipCreateTextureIAI", stdcall, dynlib: "gdiplus.dll".}
pragma(lib, "gdiplus");
extern(Windows)
int GdipCreateTextureIAI(
    GpImage* image,   // GpImage* in/out
    GpImageAttributes* imageAttributes,   // GpImageAttributes*
    int x,   // INT
    int y,   // INT
    int width,   // INT
    int height,   // INT
    GpTexture** texture   // GpTexture** in/out
);
ccall((:GdipCreateTextureIAI, "gdiplus.dll"), stdcall, Int32,
      (Ptr{GpImage}, Ptr{GpImageAttributes}, Int32, Int32, Int32, Int32, Ptr{GpTexture}),
      image, imageAttributes, x, y, width, height, texture)
# image : GpImage* in/out -> Ptr{GpImage}
# imageAttributes : GpImageAttributes* -> Ptr{GpImageAttributes}
# x : INT -> Int32
# y : INT -> Int32
# width : INT -> Int32
# height : INT -> Int32
# texture : GpTexture** in/out -> Ptr{GpTexture}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t GdipCreateTextureIAI(
    void* image,
    void* imageAttributes,
    int32_t x,
    int32_t y,
    int32_t width,
    int32_t height,
    void* texture);
]]
local gdiplus = ffi.load("gdiplus")
-- gdiplus.GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture)
-- image : GpImage* in/out
-- imageAttributes : GpImageAttributes*
-- x : INT
-- y : INT
-- width : INT
-- height : INT
-- texture : GpTexture** in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('gdiplus.dll');
const GdipCreateTextureIAI = lib.func('__stdcall', 'GdipCreateTextureIAI', 'int32_t', ['void *', 'void *', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'void *']);
// GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture)
// image : GpImage* in/out -> 'void *'
// imageAttributes : GpImageAttributes* -> 'void *'
// x : INT -> 'int32_t'
// y : INT -> 'int32_t'
// width : INT -> 'int32_t'
// height : INT -> 'int32_t'
// texture : GpTexture** in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("gdiplus.dll", {
  GdipCreateTextureIAI: { parameters: ["pointer", "pointer", "i32", "i32", "i32", "i32", "pointer"], result: "i32" },
});
// lib.symbols.GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture)
// image : GpImage* in/out -> "pointer"
// imageAttributes : GpImageAttributes* -> "pointer"
// x : INT -> "i32"
// y : INT -> "i32"
// width : INT -> "i32"
// height : INT -> "i32"
// texture : GpTexture** in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t GdipCreateTextureIAI(
    void* image,
    void* imageAttributes,
    int32_t x,
    int32_t y,
    int32_t width,
    int32_t height,
    void* texture);
C, "gdiplus.dll");
// $ffi->GdipCreateTextureIAI(image, imageAttributes, x, y, width, height, texture);
// image : GpImage* in/out
// imageAttributes : GpImageAttributes*
// x : INT
// y : INT
// width : INT
// height : INT
// texture : GpTexture** in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Gdiplus extends StdCallLibrary {
    Gdiplus INSTANCE = Native.load("gdiplus", Gdiplus.class);
    int GdipCreateTextureIAI(
        Pointer image,   // GpImage* in/out
        Pointer imageAttributes,   // GpImageAttributes*
        int x,   // INT
        int y,   // INT
        int width,   // INT
        int height,   // INT
        Pointer texture   // GpTexture** in/out
    );
}
@[Link("gdiplus")]
lib Libgdiplus
  fun GdipCreateTextureIAI = GdipCreateTextureIAI(
    image : GpImage*,   # GpImage* in/out
    imageAttributes : GpImageAttributes*,   # GpImageAttributes*
    x : Int32,   # INT
    y : Int32,   # INT
    width : Int32,   # INT
    height : Int32,   # INT
    texture : GpTexture**   # GpTexture** in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef GdipCreateTextureIAINative = Int32 Function(Pointer<Void>, Pointer<Void>, Int32, Int32, Int32, Int32, Pointer<Void>);
typedef GdipCreateTextureIAIDart = int Function(Pointer<Void>, Pointer<Void>, int, int, int, int, Pointer<Void>);
final GdipCreateTextureIAI = DynamicLibrary.open('gdiplus.dll')
    .lookupFunction<GdipCreateTextureIAINative, GdipCreateTextureIAIDart>('GdipCreateTextureIAI');
// image : GpImage* in/out -> Pointer<Void>
// imageAttributes : GpImageAttributes* -> Pointer<Void>
// x : INT -> Int32
// y : INT -> Int32
// width : INT -> Int32
// height : INT -> Int32
// texture : GpTexture** in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function 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';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "GdipCreateTextureIAI"
  c_GdipCreateTextureIAI :: Ptr () -> Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> IO Int32
-- image : GpImage* in/out -> Ptr ()
-- imageAttributes : GpImageAttributes* -> Ptr ()
-- x : INT -> Int32
-- y : INT -> Int32
-- width : INT -> Int32
-- height : INT -> Int32
-- texture : GpTexture** in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let gdipcreatetextureiai =
  foreign "GdipCreateTextureIAI"
    ((ptr void) @-> (ptr void) @-> int32_t @-> int32_t @-> int32_t @-> int32_t @-> (ptr void) @-> returning int32_t)
(* image : GpImage* in/out -> (ptr void) *)
(* imageAttributes : GpImageAttributes* -> (ptr void) *)
(* x : INT -> int32_t *)
(* y : INT -> int32_t *)
(* width : INT -> int32_t *)
(* height : INT -> int32_t *)
(* texture : GpTexture** in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library gdiplus (t "gdiplus.dll"))
(cffi:use-foreign-library gdiplus)

(cffi:defcfun ("GdipCreateTextureIAI" gdip-create-texture-iai :convention :stdcall) :int32
  (image :pointer)   ; GpImage* in/out
  (image-attributes :pointer)   ; GpImageAttributes*
  (x :int32)   ; INT
  (y :int32)   ; INT
  (width :int32)   ; INT
  (height :int32)   ; INT
  (texture :pointer))   ; GpTexture** in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $GdipCreateTextureIAI = Win32::API::More->new('gdiplus',
    'int GdipCreateTextureIAI(LPVOID image, LPVOID imageAttributes, int x, int y, int width, int height, LPVOID texture)');
# my $ret = $GdipCreateTextureIAI->Call($image, $imageAttributes, $x, $y, $width, $height, $texture);
# image : GpImage* in/out -> LPVOID
# imageAttributes : GpImageAttributes* -> LPVOID
# x : INT -> int
# y : INT -> int
# width : INT -> int
# height : INT -> int
# texture : GpTexture** in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型