ホーム › Graphics.GdiPlus › GdipGetCustomLineCapWidthScale
GdipGetCustomLineCapWidthScale
関数カスタム端点キャップの幅と線幅の比率スケールを取得する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipGetCustomLineCapWidthScale(
GpCustomLineCap* customCap,
FLOAT* widthScale
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| customCap | GpCustomLineCap* | inout |
| widthScale | FLOAT* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipGetCustomLineCapWidthScale(
GpCustomLineCap* customCap,
FLOAT* widthScale
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipGetCustomLineCapWidthScale(
IntPtr customCap, // GpCustomLineCap* in/out
ref float widthScale // FLOAT* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipGetCustomLineCapWidthScale(
customCap As IntPtr, ' GpCustomLineCap* in/out
ByRef widthScale As Single ' FLOAT* in/out
) As Integer
End Function' customCap : GpCustomLineCap* in/out
' widthScale : FLOAT* in/out
Declare PtrSafe Function GdipGetCustomLineCapWidthScale Lib "gdiplus" ( _
ByVal customCap As LongPtr, _
ByRef widthScale As Single) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipGetCustomLineCapWidthScale = ctypes.windll.gdiplus.GdipGetCustomLineCapWidthScale
GdipGetCustomLineCapWidthScale.restype = ctypes.c_int
GdipGetCustomLineCapWidthScale.argtypes = [
ctypes.c_void_p, # customCap : GpCustomLineCap* in/out
ctypes.POINTER(ctypes.c_float), # widthScale : FLOAT* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipGetCustomLineCapWidthScale = Fiddle::Function.new(
lib['GdipGetCustomLineCapWidthScale'],
[
Fiddle::TYPE_VOIDP, # customCap : GpCustomLineCap* in/out
Fiddle::TYPE_VOIDP, # widthScale : FLOAT* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipGetCustomLineCapWidthScale(
customCap: *mut GpCustomLineCap, // GpCustomLineCap* in/out
widthScale: *mut f32 // FLOAT* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipGetCustomLineCapWidthScale(IntPtr customCap, ref float widthScale);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipGetCustomLineCapWidthScale' -Namespace Win32 -PassThru
# $api::GdipGetCustomLineCapWidthScale(customCap, widthScale)#uselib "gdiplus.dll"
#func global GdipGetCustomLineCapWidthScale "GdipGetCustomLineCapWidthScale" sptr, sptr
; GdipGetCustomLineCapWidthScale varptr(customCap), varptr(widthScale) ; 戻り値は stat
; customCap : GpCustomLineCap* in/out -> "sptr"
; widthScale : FLOAT* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipGetCustomLineCapWidthScale "GdipGetCustomLineCapWidthScale" var, var ; res = GdipGetCustomLineCapWidthScale(customCap, widthScale) ; customCap : GpCustomLineCap* in/out -> "var" ; widthScale : FLOAT* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipGetCustomLineCapWidthScale "GdipGetCustomLineCapWidthScale" sptr, sptr ; res = GdipGetCustomLineCapWidthScale(varptr(customCap), varptr(widthScale)) ; customCap : GpCustomLineCap* in/out -> "sptr" ; widthScale : FLOAT* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipGetCustomLineCapWidthScale(GpCustomLineCap* customCap, FLOAT* widthScale) #uselib "gdiplus.dll" #cfunc global GdipGetCustomLineCapWidthScale "GdipGetCustomLineCapWidthScale" var, var ; res = GdipGetCustomLineCapWidthScale(customCap, widthScale) ; customCap : GpCustomLineCap* in/out -> "var" ; widthScale : FLOAT* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipGetCustomLineCapWidthScale(GpCustomLineCap* customCap, FLOAT* widthScale) #uselib "gdiplus.dll" #cfunc global GdipGetCustomLineCapWidthScale "GdipGetCustomLineCapWidthScale" intptr, intptr ; res = GdipGetCustomLineCapWidthScale(varptr(customCap), varptr(widthScale)) ; customCap : GpCustomLineCap* in/out -> "intptr" ; widthScale : FLOAT* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipGetCustomLineCapWidthScale = gdiplus.NewProc("GdipGetCustomLineCapWidthScale")
)
// customCap (GpCustomLineCap* in/out), widthScale (FLOAT* in/out)
r1, _, err := procGdipGetCustomLineCapWidthScale.Call(
uintptr(customCap),
uintptr(widthScale),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipGetCustomLineCapWidthScale(
customCap: Pointer; // GpCustomLineCap* in/out
widthScale: Pointer // FLOAT* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipGetCustomLineCapWidthScale';result := DllCall("gdiplus\GdipGetCustomLineCapWidthScale"
, "Ptr", customCap ; GpCustomLineCap* in/out
, "Ptr", widthScale ; FLOAT* in/out
, "Int") ; return: Status●GdipGetCustomLineCapWidthScale(customCap, widthScale) = DLL("gdiplus.dll", "int GdipGetCustomLineCapWidthScale(void*, void*)")
# 呼び出し: GdipGetCustomLineCapWidthScale(customCap, widthScale)
# customCap : GpCustomLineCap* in/out -> "void*"
# widthScale : FLOAT* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。