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