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