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

GdipSetPathGradientFocusScales

関数
パスグラデーションブラシの中心色領域を示す焦点スケールのXY値を設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetPathGradientFocusScales(
    GpPathGradient* brush,
    FLOAT xScale,
    FLOAT yScale
);

パラメーター

名前方向
brushGpPathGradient*inout
xScaleFLOATin
yScaleFLOATin

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipSetPathGradientFocusScales = ctypes.windll.gdiplus.GdipSetPathGradientFocusScales
GdipSetPathGradientFocusScales.restype = ctypes.c_int
GdipSetPathGradientFocusScales.argtypes = [
    ctypes.c_void_p,  # brush : GpPathGradient* in/out
    ctypes.c_float,  # xScale : FLOAT
    ctypes.c_float,  # yScale : FLOAT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetPathGradientFocusScales = gdiplus.NewProc("GdipSetPathGradientFocusScales")
)

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