ホーム › Graphics.GdiPlus › GdipAddPathStringI
GdipAddPathStringI
関数GDI+のパスに文字列の輪郭を追加する(整数版)。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipAddPathStringI(
GpPath* path,
LPCWSTR string,
INT length,
const GpFontFamily* family,
INT style,
FLOAT emSize,
const Rect* layoutRect,
const GpStringFormat* format
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| path | GpPath* | inout |
| string | LPCWSTR | in |
| length | INT | in |
| family | GpFontFamily* | in |
| style | INT | in |
| emSize | FLOAT | in |
| layoutRect | Rect* | in |
| format | GpStringFormat* | in |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipAddPathStringI(
GpPath* path,
LPCWSTR string,
INT length,
const GpFontFamily* family,
INT style,
FLOAT emSize,
const Rect* layoutRect,
const GpStringFormat* format
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipAddPathStringI(
IntPtr path, // GpPath* in/out
[MarshalAs(UnmanagedType.LPWStr)] string string, // LPCWSTR
int length, // INT
IntPtr family, // GpFontFamily*
int style, // INT
float emSize, // FLOAT
IntPtr layoutRect, // Rect*
IntPtr format // GpStringFormat*
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipAddPathStringI(
path As IntPtr, ' GpPath* in/out
<MarshalAs(UnmanagedType.LPWStr)> [string] As String, ' LPCWSTR
length As Integer, ' INT
family As IntPtr, ' GpFontFamily*
style As Integer, ' INT
emSize As Single, ' FLOAT
layoutRect As IntPtr, ' Rect*
format As IntPtr ' GpStringFormat*
) As Integer
End Function' path : GpPath* in/out
' string : LPCWSTR
' length : INT
' family : GpFontFamily*
' style : INT
' emSize : FLOAT
' layoutRect : Rect*
' format : GpStringFormat*
Declare PtrSafe Function GdipAddPathStringI Lib "gdiplus" ( _
ByVal path As LongPtr, _
ByVal string As LongPtr, _
ByVal length As Long, _
ByVal family As LongPtr, _
ByVal style As Long, _
ByVal emSize As Single, _
ByVal layoutRect As LongPtr, _
ByVal format As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipAddPathStringI = ctypes.windll.gdiplus.GdipAddPathStringI
GdipAddPathStringI.restype = ctypes.c_int
GdipAddPathStringI.argtypes = [
ctypes.c_void_p, # path : GpPath* in/out
wintypes.LPCWSTR, # string : LPCWSTR
ctypes.c_int, # length : INT
ctypes.c_void_p, # family : GpFontFamily*
ctypes.c_int, # style : INT
ctypes.c_float, # emSize : FLOAT
ctypes.c_void_p, # layoutRect : Rect*
ctypes.c_void_p, # format : GpStringFormat*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipAddPathStringI = Fiddle::Function.new(
lib['GdipAddPathStringI'],
[
Fiddle::TYPE_VOIDP, # path : GpPath* in/out
Fiddle::TYPE_VOIDP, # string : LPCWSTR
Fiddle::TYPE_INT, # length : INT
Fiddle::TYPE_VOIDP, # family : GpFontFamily*
Fiddle::TYPE_INT, # style : INT
Fiddle::TYPE_FLOAT, # emSize : FLOAT
Fiddle::TYPE_VOIDP, # layoutRect : Rect*
Fiddle::TYPE_VOIDP, # format : GpStringFormat*
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipAddPathStringI(
path: *mut GpPath, // GpPath* in/out
string: *const u16, // LPCWSTR
length: i32, // INT
family: *const GpFontFamily, // GpFontFamily*
style: i32, // INT
emSize: f32, // FLOAT
layoutRect: *const Rect, // Rect*
format: *const GpStringFormat // GpStringFormat*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipAddPathStringI(IntPtr path, [MarshalAs(UnmanagedType.LPWStr)] string string, int length, IntPtr family, int style, float emSize, IntPtr layoutRect, IntPtr format);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipAddPathStringI' -Namespace Win32 -PassThru
# $api::GdipAddPathStringI(path, string, length, family, style, emSize, layoutRect, format)#uselib "gdiplus.dll"
#func global GdipAddPathStringI "GdipAddPathStringI" sptr, sptr, sptr, sptr, sptr, float, sptr, sptr
; GdipAddPathStringI varptr(path), string, length, varptr(family), style, emSize, varptr(layoutRect), varptr(format) ; 戻り値は stat
; path : GpPath* in/out -> "sptr"
; string : LPCWSTR -> "sptr"
; length : INT -> "sptr"
; family : GpFontFamily* -> "sptr"
; style : INT -> "sptr"
; emSize : FLOAT -> "float"
; layoutRect : Rect* -> "sptr"
; format : GpStringFormat* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipAddPathStringI "GdipAddPathStringI" var, wstr, int, var, int, float, var, var ; res = GdipAddPathStringI(path, string, length, family, style, emSize, layoutRect, format) ; path : GpPath* in/out -> "var" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; family : GpFontFamily* -> "var" ; style : INT -> "int" ; emSize : FLOAT -> "float" ; layoutRect : Rect* -> "var" ; format : GpStringFormat* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipAddPathStringI "GdipAddPathStringI" sptr, wstr, int, sptr, int, float, sptr, sptr ; res = GdipAddPathStringI(varptr(path), string, length, varptr(family), style, emSize, varptr(layoutRect), varptr(format)) ; path : GpPath* in/out -> "sptr" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; family : GpFontFamily* -> "sptr" ; style : INT -> "int" ; emSize : FLOAT -> "float" ; layoutRect : Rect* -> "sptr" ; format : GpStringFormat* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipAddPathStringI(GpPath* path, LPCWSTR string, INT length, GpFontFamily* family, INT style, FLOAT emSize, Rect* layoutRect, GpStringFormat* format) #uselib "gdiplus.dll" #cfunc global GdipAddPathStringI "GdipAddPathStringI" var, wstr, int, var, int, float, var, var ; res = GdipAddPathStringI(path, string, length, family, style, emSize, layoutRect, format) ; path : GpPath* in/out -> "var" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; family : GpFontFamily* -> "var" ; style : INT -> "int" ; emSize : FLOAT -> "float" ; layoutRect : Rect* -> "var" ; format : GpStringFormat* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipAddPathStringI(GpPath* path, LPCWSTR string, INT length, GpFontFamily* family, INT style, FLOAT emSize, Rect* layoutRect, GpStringFormat* format) #uselib "gdiplus.dll" #cfunc global GdipAddPathStringI "GdipAddPathStringI" intptr, wstr, int, intptr, int, float, intptr, intptr ; res = GdipAddPathStringI(varptr(path), string, length, varptr(family), style, emSize, varptr(layoutRect), varptr(format)) ; path : GpPath* in/out -> "intptr" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; family : GpFontFamily* -> "intptr" ; style : INT -> "int" ; emSize : FLOAT -> "float" ; layoutRect : Rect* -> "intptr" ; format : GpStringFormat* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipAddPathStringI = gdiplus.NewProc("GdipAddPathStringI")
)
// path (GpPath* in/out), string (LPCWSTR), length (INT), family (GpFontFamily*), style (INT), emSize (FLOAT), layoutRect (Rect*), format (GpStringFormat*)
r1, _, err := procGdipAddPathStringI.Call(
uintptr(path),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(string))),
uintptr(length),
uintptr(family),
uintptr(style),
uintptr(math.Float32bits(emSize)),
uintptr(layoutRect),
uintptr(format),
)
_ = 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 GdipAddPathStringI(
path: Pointer; // GpPath* in/out
string: PWideChar; // LPCWSTR
length: Integer; // INT
family: Pointer; // GpFontFamily*
style: Integer; // INT
emSize: Single; // FLOAT
layoutRect: Pointer; // Rect*
format: Pointer // GpStringFormat*
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipAddPathStringI';result := DllCall("gdiplus\GdipAddPathStringI"
, "Ptr", path ; GpPath* in/out
, "WStr", string ; LPCWSTR
, "Int", length ; INT
, "Ptr", family ; GpFontFamily*
, "Int", style ; INT
, "Float", emSize ; FLOAT
, "Ptr", layoutRect ; Rect*
, "Ptr", format ; GpStringFormat*
, "Int") ; return: Status●GdipAddPathStringI(path, string, length, family, style, emSize, layoutRect, format) = DLL("gdiplus.dll", "int GdipAddPathStringI(void*, char*, int, void*, int, float, void*, void*)")
# 呼び出し: GdipAddPathStringI(path, string, length, family, style, emSize, layoutRect, format)
# path : GpPath* in/out -> "void*"
# string : LPCWSTR -> "char*"
# length : INT -> "int"
# family : GpFontFamily* -> "void*"
# style : INT -> "int"
# emSize : FLOAT -> "float"
# layoutRect : Rect* -> "void*"
# format : GpStringFormat* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。