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

GdipSetCustomLineCapWidthScale

関数
カスタム端点キャップの幅と線幅の比率スケールを設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetCustomLineCapWidthScale(
    GpCustomLineCap* customCap,
    FLOAT widthScale
);

パラメーター

名前方向
customCapGpCustomLineCap*inout
widthScaleFLOATin

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipSetCustomLineCapWidthScale(
    GpCustomLineCap* customCap,
    FLOAT widthScale
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetCustomLineCapWidthScale(
    IntPtr customCap,   // GpCustomLineCap* in/out
    float widthScale   // FLOAT
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetCustomLineCapWidthScale(
    customCap As IntPtr,   ' GpCustomLineCap* in/out
    widthScale As Single   ' FLOAT
) As Integer
End Function
' customCap : GpCustomLineCap* in/out
' widthScale : FLOAT
Declare PtrSafe Function GdipSetCustomLineCapWidthScale Lib "gdiplus" ( _
    ByVal customCap As LongPtr, _
    ByVal widthScale As Single) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipSetCustomLineCapWidthScale = ctypes.windll.gdiplus.GdipSetCustomLineCapWidthScale
GdipSetCustomLineCapWidthScale.restype = ctypes.c_int
GdipSetCustomLineCapWidthScale.argtypes = [
    ctypes.c_void_p,  # customCap : GpCustomLineCap* in/out
    ctypes.c_float,  # widthScale : FLOAT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetCustomLineCapWidthScale = gdiplus.NewProc("GdipSetCustomLineCapWidthScale")
)

// customCap (GpCustomLineCap* in/out), widthScale (FLOAT)
r1, _, err := procGdipSetCustomLineCapWidthScale.Call(
	uintptr(customCap),
	uintptr(math.Float32bits(widthScale)),
)
_ = 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 GdipSetCustomLineCapWidthScale(
  customCap: Pointer;   // GpCustomLineCap* in/out
  widthScale: Single   // FLOAT
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipSetCustomLineCapWidthScale';
result := DllCall("gdiplus\GdipSetCustomLineCapWidthScale"
    , "Ptr", customCap   ; GpCustomLineCap* in/out
    , "Float", widthScale   ; FLOAT
    , "Int")   ; return: Status
●GdipSetCustomLineCapWidthScale(customCap, widthScale) = DLL("gdiplus.dll", "int GdipSetCustomLineCapWidthScale(void*, float)")
# 呼び出し: GdipSetCustomLineCapWidthScale(customCap, widthScale)
# customCap : GpCustomLineCap* in/out -> "void*"
# widthScale : FLOAT -> "float"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。