ホーム › Graphics.GdiPlus › GdipEnumerateMetafileSrcRectDestPoints
GdipEnumerateMetafileSrcRectDestPoints
関数元矩形と描画先複数点を指定してメタファイルを列挙する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipEnumerateMetafileSrcRectDestPoints(
GpGraphics* graphics,
const GpMetafile* metafile,
const PointF* destPoints,
INT count,
const RectF* srcRect,
Unit srcUnit,
INT_PTR callback,
void* callbackData,
const GpImageAttributes* imageAttributes
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| graphics | GpGraphics* | inout | 再生先のGDI+グラフィックスオブジェクトへのポインタ。 |
| metafile | GpMetafile* | in | 列挙対象のメタファイルオブジェクトへのポインタ。 |
| destPoints | PointF* | in | 描画先の平行四辺形を定義する点配列(PointF)。3点を指定する。 |
| count | INT | in | destPoints配列内の点の個数。通常は3。 |
| srcRect | RectF* | in | メタファイルから切り出す元矩形(RectF)へのポインタ。 |
| srcUnit | Unit | in | srcRectの座標単位を示すUnit列挙値。 |
| callback | INT_PTR | in | 各メタファイルレコードごとに呼ばれるEnumerateMetafileProcへのアドレス。 |
| callbackData | void* | inout | コールバックへ渡す任意データへのポインタ。NULL可。 |
| imageAttributes | GpImageAttributes* | in | 色調整など描画属性を指定するImageAttributesへのポインタ。NULL可。 |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipEnumerateMetafileSrcRectDestPoints(
GpGraphics* graphics,
const GpMetafile* metafile,
const PointF* destPoints,
INT count,
const RectF* srcRect,
Unit srcUnit,
INT_PTR callback,
void* callbackData,
const GpImageAttributes* imageAttributes
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipEnumerateMetafileSrcRectDestPoints(
IntPtr graphics, // GpGraphics* in/out
IntPtr metafile, // GpMetafile*
IntPtr destPoints, // PointF*
int count, // INT
IntPtr srcRect, // RectF*
int srcUnit, // Unit
IntPtr callback, // INT_PTR
IntPtr callbackData, // void* in/out
IntPtr imageAttributes // GpImageAttributes*
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipEnumerateMetafileSrcRectDestPoints(
graphics As IntPtr, ' GpGraphics* in/out
metafile As IntPtr, ' GpMetafile*
destPoints As IntPtr, ' PointF*
count As Integer, ' INT
srcRect As IntPtr, ' RectF*
srcUnit As Integer, ' Unit
callback As IntPtr, ' INT_PTR
callbackData As IntPtr, ' void* in/out
imageAttributes As IntPtr ' GpImageAttributes*
) As Integer
End Function' graphics : GpGraphics* in/out
' metafile : GpMetafile*
' destPoints : PointF*
' count : INT
' srcRect : RectF*
' srcUnit : Unit
' callback : INT_PTR
' callbackData : void* in/out
' imageAttributes : GpImageAttributes*
Declare PtrSafe Function GdipEnumerateMetafileSrcRectDestPoints Lib "gdiplus" ( _
ByVal graphics As LongPtr, _
ByVal metafile As LongPtr, _
ByVal destPoints As LongPtr, _
ByVal count As Long, _
ByVal srcRect As LongPtr, _
ByVal srcUnit As Long, _
ByVal callback As LongPtr, _
ByVal callbackData As LongPtr, _
ByVal imageAttributes As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipEnumerateMetafileSrcRectDestPoints = ctypes.windll.gdiplus.GdipEnumerateMetafileSrcRectDestPoints
GdipEnumerateMetafileSrcRectDestPoints.restype = ctypes.c_int
GdipEnumerateMetafileSrcRectDestPoints.argtypes = [
ctypes.c_void_p, # graphics : GpGraphics* in/out
ctypes.c_void_p, # metafile : GpMetafile*
ctypes.c_void_p, # destPoints : PointF*
ctypes.c_int, # count : INT
ctypes.c_void_p, # srcRect : RectF*
ctypes.c_int, # srcUnit : Unit
ctypes.c_ssize_t, # callback : INT_PTR
ctypes.POINTER(None), # callbackData : void* in/out
ctypes.c_void_p, # imageAttributes : GpImageAttributes*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipEnumerateMetafileSrcRectDestPoints = Fiddle::Function.new(
lib['GdipEnumerateMetafileSrcRectDestPoints'],
[
Fiddle::TYPE_VOIDP, # graphics : GpGraphics* in/out
Fiddle::TYPE_VOIDP, # metafile : GpMetafile*
Fiddle::TYPE_VOIDP, # destPoints : PointF*
Fiddle::TYPE_INT, # count : INT
Fiddle::TYPE_VOIDP, # srcRect : RectF*
Fiddle::TYPE_INT, # srcUnit : Unit
Fiddle::TYPE_INTPTR_T, # callback : INT_PTR
Fiddle::TYPE_VOIDP, # callbackData : void* in/out
Fiddle::TYPE_VOIDP, # imageAttributes : GpImageAttributes*
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipEnumerateMetafileSrcRectDestPoints(
graphics: *mut GpGraphics, // GpGraphics* in/out
metafile: *const GpMetafile, // GpMetafile*
destPoints: *const PointF, // PointF*
count: i32, // INT
srcRect: *const RectF, // RectF*
srcUnit: i32, // Unit
callback: isize, // INT_PTR
callbackData: *mut (), // void* in/out
imageAttributes: *const GpImageAttributes // GpImageAttributes*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipEnumerateMetafileSrcRectDestPoints(IntPtr graphics, IntPtr metafile, IntPtr destPoints, int count, IntPtr srcRect, int srcUnit, IntPtr callback, IntPtr callbackData, IntPtr imageAttributes);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipEnumerateMetafileSrcRectDestPoints' -Namespace Win32 -PassThru
# $api::GdipEnumerateMetafileSrcRectDestPoints(graphics, metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, imageAttributes)#uselib "gdiplus.dll"
#func global GdipEnumerateMetafileSrcRectDestPoints "GdipEnumerateMetafileSrcRectDestPoints" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; GdipEnumerateMetafileSrcRectDestPoints varptr(graphics), varptr(metafile), varptr(destPoints), count, varptr(srcRect), srcUnit, callback, callbackData, varptr(imageAttributes) ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; metafile : GpMetafile* -> "sptr"
; destPoints : PointF* -> "sptr"
; count : INT -> "sptr"
; srcRect : RectF* -> "sptr"
; srcUnit : Unit -> "sptr"
; callback : INT_PTR -> "sptr"
; callbackData : void* in/out -> "sptr"
; imageAttributes : GpImageAttributes* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipEnumerateMetafileSrcRectDestPoints "GdipEnumerateMetafileSrcRectDestPoints" var, var, var, int, var, int, sptr, sptr, var ; res = GdipEnumerateMetafileSrcRectDestPoints(graphics, metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, imageAttributes) ; graphics : GpGraphics* in/out -> "var" ; metafile : GpMetafile* -> "var" ; destPoints : PointF* -> "var" ; count : INT -> "int" ; srcRect : RectF* -> "var" ; srcUnit : Unit -> "int" ; callback : INT_PTR -> "sptr" ; callbackData : void* in/out -> "sptr" ; imageAttributes : GpImageAttributes* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipEnumerateMetafileSrcRectDestPoints "GdipEnumerateMetafileSrcRectDestPoints" sptr, sptr, sptr, int, sptr, int, sptr, sptr, sptr ; res = GdipEnumerateMetafileSrcRectDestPoints(varptr(graphics), varptr(metafile), varptr(destPoints), count, varptr(srcRect), srcUnit, callback, callbackData, varptr(imageAttributes)) ; graphics : GpGraphics* in/out -> "sptr" ; metafile : GpMetafile* -> "sptr" ; destPoints : PointF* -> "sptr" ; count : INT -> "int" ; srcRect : RectF* -> "sptr" ; srcUnit : Unit -> "int" ; callback : INT_PTR -> "sptr" ; callbackData : void* in/out -> "sptr" ; imageAttributes : GpImageAttributes* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipEnumerateMetafileSrcRectDestPoints(GpGraphics* graphics, GpMetafile* metafile, PointF* destPoints, INT count, RectF* srcRect, Unit srcUnit, INT_PTR callback, void* callbackData, GpImageAttributes* imageAttributes) #uselib "gdiplus.dll" #cfunc global GdipEnumerateMetafileSrcRectDestPoints "GdipEnumerateMetafileSrcRectDestPoints" var, var, var, int, var, int, intptr, intptr, var ; res = GdipEnumerateMetafileSrcRectDestPoints(graphics, metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, imageAttributes) ; graphics : GpGraphics* in/out -> "var" ; metafile : GpMetafile* -> "var" ; destPoints : PointF* -> "var" ; count : INT -> "int" ; srcRect : RectF* -> "var" ; srcUnit : Unit -> "int" ; callback : INT_PTR -> "intptr" ; callbackData : void* in/out -> "intptr" ; imageAttributes : GpImageAttributes* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipEnumerateMetafileSrcRectDestPoints(GpGraphics* graphics, GpMetafile* metafile, PointF* destPoints, INT count, RectF* srcRect, Unit srcUnit, INT_PTR callback, void* callbackData, GpImageAttributes* imageAttributes) #uselib "gdiplus.dll" #cfunc global GdipEnumerateMetafileSrcRectDestPoints "GdipEnumerateMetafileSrcRectDestPoints" intptr, intptr, intptr, int, intptr, int, intptr, intptr, intptr ; res = GdipEnumerateMetafileSrcRectDestPoints(varptr(graphics), varptr(metafile), varptr(destPoints), count, varptr(srcRect), srcUnit, callback, callbackData, varptr(imageAttributes)) ; graphics : GpGraphics* in/out -> "intptr" ; metafile : GpMetafile* -> "intptr" ; destPoints : PointF* -> "intptr" ; count : INT -> "int" ; srcRect : RectF* -> "intptr" ; srcUnit : Unit -> "int" ; callback : INT_PTR -> "intptr" ; callbackData : void* in/out -> "intptr" ; imageAttributes : GpImageAttributes* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipEnumerateMetafileSrcRectDestPoints = gdiplus.NewProc("GdipEnumerateMetafileSrcRectDestPoints")
)
// graphics (GpGraphics* in/out), metafile (GpMetafile*), destPoints (PointF*), count (INT), srcRect (RectF*), srcUnit (Unit), callback (INT_PTR), callbackData (void* in/out), imageAttributes (GpImageAttributes*)
r1, _, err := procGdipEnumerateMetafileSrcRectDestPoints.Call(
uintptr(graphics),
uintptr(metafile),
uintptr(destPoints),
uintptr(count),
uintptr(srcRect),
uintptr(srcUnit),
uintptr(callback),
uintptr(callbackData),
uintptr(imageAttributes),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipEnumerateMetafileSrcRectDestPoints(
graphics: Pointer; // GpGraphics* in/out
metafile: Pointer; // GpMetafile*
destPoints: Pointer; // PointF*
count: Integer; // INT
srcRect: Pointer; // RectF*
srcUnit: Integer; // Unit
callback: NativeInt; // INT_PTR
callbackData: Pointer; // void* in/out
imageAttributes: Pointer // GpImageAttributes*
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipEnumerateMetafileSrcRectDestPoints';result := DllCall("gdiplus\GdipEnumerateMetafileSrcRectDestPoints"
, "Ptr", graphics ; GpGraphics* in/out
, "Ptr", metafile ; GpMetafile*
, "Ptr", destPoints ; PointF*
, "Int", count ; INT
, "Ptr", srcRect ; RectF*
, "Int", srcUnit ; Unit
, "Ptr", callback ; INT_PTR
, "Ptr", callbackData ; void* in/out
, "Ptr", imageAttributes ; GpImageAttributes*
, "Int") ; return: Status●GdipEnumerateMetafileSrcRectDestPoints(graphics, metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, imageAttributes) = DLL("gdiplus.dll", "int GdipEnumerateMetafileSrcRectDestPoints(void*, void*, void*, int, void*, int, int, void*, void*)")
# 呼び出し: GdipEnumerateMetafileSrcRectDestPoints(graphics, metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, imageAttributes)
# graphics : GpGraphics* in/out -> "void*"
# metafile : GpMetafile* -> "void*"
# destPoints : PointF* -> "void*"
# count : INT -> "int"
# srcRect : RectF* -> "void*"
# srcUnit : Unit -> "int"
# callback : INT_PTR -> "int"
# callbackData : void* in/out -> "void*"
# imageAttributes : GpImageAttributes* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。