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