ホーム › Graphics.Gdi › SetStretchBltMode
SetStretchBltMode
関数ビットマップ伸縮時のラスタ補間モードを設定する。
シグネチャ
// GDI32.dll
#include <windows.h>
INT SetStretchBltMode(
HDC hdc,
STRETCH_BLT_MODE mode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hdc | HDC | in |
| mode | STRETCH_BLT_MODE | in |
戻り値の型: INT
各言語での呼び出し定義
// GDI32.dll
#include <windows.h>
INT SetStretchBltMode(
HDC hdc,
STRETCH_BLT_MODE mode
);[DllImport("GDI32.dll", ExactSpelling = true)]
static extern int SetStretchBltMode(
IntPtr hdc, // HDC
int mode // STRETCH_BLT_MODE
);<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function SetStretchBltMode(
hdc As IntPtr, ' HDC
mode As Integer ' STRETCH_BLT_MODE
) As Integer
End Function' hdc : HDC
' mode : STRETCH_BLT_MODE
Declare PtrSafe Function SetStretchBltMode Lib "gdi32" ( _
ByVal hdc As LongPtr, _
ByVal mode As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SetStretchBltMode = ctypes.windll.gdi32.SetStretchBltMode
SetStretchBltMode.restype = ctypes.c_int
SetStretchBltMode.argtypes = [
wintypes.HANDLE, # hdc : HDC
ctypes.c_int, # mode : STRETCH_BLT_MODE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
SetStretchBltMode = Fiddle::Function.new(
lib['SetStretchBltMode'],
[
Fiddle::TYPE_VOIDP, # hdc : HDC
Fiddle::TYPE_INT, # mode : STRETCH_BLT_MODE
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn SetStretchBltMode(
hdc: *mut core::ffi::c_void, // HDC
mode: i32 // STRETCH_BLT_MODE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("GDI32.dll")]
public static extern int SetStretchBltMode(IntPtr hdc, int mode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_SetStretchBltMode' -Namespace Win32 -PassThru
# $api::SetStretchBltMode(hdc, mode)#uselib "GDI32.dll"
#func global SetStretchBltMode "SetStretchBltMode" sptr, sptr
; SetStretchBltMode hdc, mode ; 戻り値は stat
; hdc : HDC -> "sptr"
; mode : STRETCH_BLT_MODE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "GDI32.dll"
#cfunc global SetStretchBltMode "SetStretchBltMode" sptr, int
; res = SetStretchBltMode(hdc, mode)
; hdc : HDC -> "sptr"
; mode : STRETCH_BLT_MODE -> "int"; INT SetStretchBltMode(HDC hdc, STRETCH_BLT_MODE mode)
#uselib "GDI32.dll"
#cfunc global SetStretchBltMode "SetStretchBltMode" intptr, int
; res = SetStretchBltMode(hdc, mode)
; hdc : HDC -> "intptr"
; mode : STRETCH_BLT_MODE -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procSetStretchBltMode = gdi32.NewProc("SetStretchBltMode")
)
// hdc (HDC), mode (STRETCH_BLT_MODE)
r1, _, err := procSetStretchBltMode.Call(
uintptr(hdc),
uintptr(mode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction SetStretchBltMode(
hdc: THandle; // HDC
mode: Integer // STRETCH_BLT_MODE
): Integer; stdcall;
external 'GDI32.dll' name 'SetStretchBltMode';result := DllCall("GDI32\SetStretchBltMode"
, "Ptr", hdc ; HDC
, "Int", mode ; STRETCH_BLT_MODE
, "Int") ; return: INT●SetStretchBltMode(hdc, mode) = DLL("GDI32.dll", "int SetStretchBltMode(void*, int)")
# 呼び出し: SetStretchBltMode(hdc, mode)
# hdc : HDC -> "void*"
# mode : STRETCH_BLT_MODE -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。