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

GdipWarpPath

関数
ワープ変換を適用してGDI+のパスを変形する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipWarpPath(
    GpPath* path,
    Matrix* matrix,
    const PointF* points,
    INT count,
    FLOAT srcx,
    FLOAT srcy,
    FLOAT srcwidth,
    FLOAT srcheight,
    WarpMode warpMode,
    FLOAT flatness
);

パラメーター

名前方向
pathGpPath*inout
matrixMatrix*inout
pointsPointF*in
countINTin
srcxFLOATin
srcyFLOATin
srcwidthFLOATin
srcheightFLOATin
warpModeWarpModein
flatnessFLOATin

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipWarpPath(
    GpPath* path,
    Matrix* matrix,
    const PointF* points,
    INT count,
    FLOAT srcx,
    FLOAT srcy,
    FLOAT srcwidth,
    FLOAT srcheight,
    WarpMode warpMode,
    FLOAT flatness
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipWarpPath(
    IntPtr path,   // GpPath* in/out
    ref IntPtr matrix,   // Matrix* in/out
    IntPtr points,   // PointF*
    int count,   // INT
    float srcx,   // FLOAT
    float srcy,   // FLOAT
    float srcwidth,   // FLOAT
    float srcheight,   // FLOAT
    int warpMode,   // WarpMode
    float flatness   // FLOAT
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipWarpPath(
    path As IntPtr,   ' GpPath* in/out
    ByRef matrix As IntPtr,   ' Matrix* in/out
    points As IntPtr,   ' PointF*
    count As Integer,   ' INT
    srcx As Single,   ' FLOAT
    srcy As Single,   ' FLOAT
    srcwidth As Single,   ' FLOAT
    srcheight As Single,   ' FLOAT
    warpMode As Integer,   ' WarpMode
    flatness As Single   ' FLOAT
) As Integer
End Function
' path : GpPath* in/out
' matrix : Matrix* in/out
' points : PointF*
' count : INT
' srcx : FLOAT
' srcy : FLOAT
' srcwidth : FLOAT
' srcheight : FLOAT
' warpMode : WarpMode
' flatness : FLOAT
Declare PtrSafe Function GdipWarpPath Lib "gdiplus" ( _
    ByVal path As LongPtr, _
    ByRef matrix As LongPtr, _
    ByVal points As LongPtr, _
    ByVal count As Long, _
    ByVal srcx As Single, _
    ByVal srcy As Single, _
    ByVal srcwidth As Single, _
    ByVal srcheight As Single, _
    ByVal warpMode As Long, _
    ByVal flatness As Single) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipWarpPath = ctypes.windll.gdiplus.GdipWarpPath
GdipWarpPath.restype = ctypes.c_int
GdipWarpPath.argtypes = [
    ctypes.c_void_p,  # path : GpPath* in/out
    ctypes.c_void_p,  # matrix : Matrix* in/out
    ctypes.c_void_p,  # points : PointF*
    ctypes.c_int,  # count : INT
    ctypes.c_float,  # srcx : FLOAT
    ctypes.c_float,  # srcy : FLOAT
    ctypes.c_float,  # srcwidth : FLOAT
    ctypes.c_float,  # srcheight : FLOAT
    ctypes.c_int,  # warpMode : WarpMode
    ctypes.c_float,  # flatness : FLOAT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipWarpPath = Fiddle::Function.new(
  lib['GdipWarpPath'],
  [
    Fiddle::TYPE_VOIDP,  # path : GpPath* in/out
    Fiddle::TYPE_VOIDP,  # matrix : Matrix* in/out
    Fiddle::TYPE_VOIDP,  # points : PointF*
    Fiddle::TYPE_INT,  # count : INT
    Fiddle::TYPE_FLOAT,  # srcx : FLOAT
    Fiddle::TYPE_FLOAT,  # srcy : FLOAT
    Fiddle::TYPE_FLOAT,  # srcwidth : FLOAT
    Fiddle::TYPE_FLOAT,  # srcheight : FLOAT
    Fiddle::TYPE_INT,  # warpMode : WarpMode
    Fiddle::TYPE_FLOAT,  # flatness : FLOAT
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipWarpPath(
        path: *mut GpPath,  // GpPath* in/out
        matrix: *mut isize,  // Matrix* in/out
        points: *const PointF,  // PointF*
        count: i32,  // INT
        srcx: f32,  // FLOAT
        srcy: f32,  // FLOAT
        srcwidth: f32,  // FLOAT
        srcheight: f32,  // FLOAT
        warpMode: i32,  // WarpMode
        flatness: f32  // FLOAT
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipWarpPath(IntPtr path, ref IntPtr matrix, IntPtr points, int count, float srcx, float srcy, float srcwidth, float srcheight, int warpMode, float flatness);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipWarpPath' -Namespace Win32 -PassThru
# $api::GdipWarpPath(path, matrix, points, count, srcx, srcy, srcwidth, srcheight, warpMode, flatness)
#uselib "gdiplus.dll"
#func global GdipWarpPath "GdipWarpPath" sptr, sptr, sptr, sptr, float, float, float, float, sptr, float
; GdipWarpPath varptr(path), matrix, varptr(points), count, srcx, srcy, srcwidth, srcheight, warpMode, flatness   ; 戻り値は stat
; path : GpPath* in/out -> "sptr"
; matrix : Matrix* in/out -> "sptr"
; points : PointF* -> "sptr"
; count : INT -> "sptr"
; srcx : FLOAT -> "float"
; srcy : FLOAT -> "float"
; srcwidth : FLOAT -> "float"
; srcheight : FLOAT -> "float"
; warpMode : WarpMode -> "sptr"
; flatness : FLOAT -> "float"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipWarpPath "GdipWarpPath" var, int, var, int, float, float, float, float, int, float
; res = GdipWarpPath(path, matrix, points, count, srcx, srcy, srcwidth, srcheight, warpMode, flatness)
; path : GpPath* in/out -> "var"
; matrix : Matrix* in/out -> "int"
; points : PointF* -> "var"
; count : INT -> "int"
; srcx : FLOAT -> "float"
; srcy : FLOAT -> "float"
; srcwidth : FLOAT -> "float"
; srcheight : FLOAT -> "float"
; warpMode : WarpMode -> "int"
; flatness : FLOAT -> "float"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipWarpPath(GpPath* path, Matrix* matrix, PointF* points, INT count, FLOAT srcx, FLOAT srcy, FLOAT srcwidth, FLOAT srcheight, WarpMode warpMode, FLOAT flatness)
#uselib "gdiplus.dll"
#cfunc global GdipWarpPath "GdipWarpPath" var, int, var, int, float, float, float, float, int, float
; res = GdipWarpPath(path, matrix, points, count, srcx, srcy, srcwidth, srcheight, warpMode, flatness)
; path : GpPath* in/out -> "var"
; matrix : Matrix* in/out -> "int"
; points : PointF* -> "var"
; count : INT -> "int"
; srcx : FLOAT -> "float"
; srcy : FLOAT -> "float"
; srcwidth : FLOAT -> "float"
; srcheight : FLOAT -> "float"
; warpMode : WarpMode -> "int"
; flatness : FLOAT -> "float"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipWarpPath = gdiplus.NewProc("GdipWarpPath")
)

// path (GpPath* in/out), matrix (Matrix* in/out), points (PointF*), count (INT), srcx (FLOAT), srcy (FLOAT), srcwidth (FLOAT), srcheight (FLOAT), warpMode (WarpMode), flatness (FLOAT)
r1, _, err := procGdipWarpPath.Call(
	uintptr(path),
	uintptr(matrix),
	uintptr(points),
	uintptr(count),
	uintptr(math.Float32bits(srcx)),
	uintptr(math.Float32bits(srcy)),
	uintptr(math.Float32bits(srcwidth)),
	uintptr(math.Float32bits(srcheight)),
	uintptr(warpMode),
	uintptr(math.Float32bits(flatness)),
)
_ = 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 GdipWarpPath(
  path: Pointer;   // GpPath* in/out
  matrix: Pointer;   // Matrix* in/out
  points: Pointer;   // PointF*
  count: Integer;   // INT
  srcx: Single;   // FLOAT
  srcy: Single;   // FLOAT
  srcwidth: Single;   // FLOAT
  srcheight: Single;   // FLOAT
  warpMode: Integer;   // WarpMode
  flatness: Single   // FLOAT
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipWarpPath';
result := DllCall("gdiplus\GdipWarpPath"
    , "Ptr", path   ; GpPath* in/out
    , "Ptr", matrix   ; Matrix* in/out
    , "Ptr", points   ; PointF*
    , "Int", count   ; INT
    , "Float", srcx   ; FLOAT
    , "Float", srcy   ; FLOAT
    , "Float", srcwidth   ; FLOAT
    , "Float", srcheight   ; FLOAT
    , "Int", warpMode   ; WarpMode
    , "Float", flatness   ; FLOAT
    , "Int")   ; return: Status
●GdipWarpPath(path, matrix, points, count, srcx, srcy, srcwidth, srcheight, warpMode, flatness) = DLL("gdiplus.dll", "int GdipWarpPath(void*, void*, void*, int, float, float, float, float, int, float)")
# 呼び出し: GdipWarpPath(path, matrix, points, count, srcx, srcy, srcwidth, srcheight, warpMode, flatness)
# path : GpPath* in/out -> "void*"
# matrix : Matrix* in/out -> "void*"
# points : PointF* -> "void*"
# count : INT -> "int"
# srcx : FLOAT -> "float"
# srcy : FLOAT -> "float"
# srcwidth : FLOAT -> "float"
# srcheight : FLOAT -> "float"
# warpMode : WarpMode -> "int"
# flatness : FLOAT -> "float"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。