Win32 API 日本語リファレンス
ホームMedia.Multimedia › DrawDibRealize

DrawDibRealize

関数
DrawDibのパレットをデバイスコンテキストに実現する。
DLLMSVFW32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD DrawDibRealize(
    INT_PTR hdd,
    HDC hdc,
    BOOL fBackground
);

パラメーター

名前方向
hddINT_PTRin
hdcHDCin
fBackgroundBOOLin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD DrawDibRealize(
    INT_PTR hdd,
    HDC hdc,
    BOOL fBackground
);
[DllImport("MSVFW32.dll", ExactSpelling = true)]
static extern uint DrawDibRealize(
    IntPtr hdd,   // INT_PTR
    IntPtr hdc,   // HDC
    bool fBackground   // BOOL
);
<DllImport("MSVFW32.dll", ExactSpelling:=True)>
Public Shared Function DrawDibRealize(
    hdd As IntPtr,   ' INT_PTR
    hdc As IntPtr,   ' HDC
    fBackground As Boolean   ' BOOL
) As UInteger
End Function
' hdd : INT_PTR
' hdc : HDC
' fBackground : BOOL
Declare PtrSafe Function DrawDibRealize Lib "msvfw32" ( _
    ByVal hdd As LongPtr, _
    ByVal hdc As LongPtr, _
    ByVal fBackground As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DrawDibRealize = ctypes.windll.msvfw32.DrawDibRealize
DrawDibRealize.restype = wintypes.DWORD
DrawDibRealize.argtypes = [
    ctypes.c_ssize_t,  # hdd : INT_PTR
    wintypes.HANDLE,  # hdc : HDC
    wintypes.BOOL,  # fBackground : BOOL
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSVFW32.dll')
DrawDibRealize = Fiddle::Function.new(
  lib['DrawDibRealize'],
  [
    Fiddle::TYPE_INTPTR_T,  # hdd : INT_PTR
    Fiddle::TYPE_VOIDP,  # hdc : HDC
    Fiddle::TYPE_INT,  # fBackground : BOOL
  ],
  -Fiddle::TYPE_INT)
#[link(name = "msvfw32")]
extern "system" {
    fn DrawDibRealize(
        hdd: isize,  // INT_PTR
        hdc: *mut core::ffi::c_void,  // HDC
        fBackground: i32  // BOOL
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSVFW32.dll")]
public static extern uint DrawDibRealize(IntPtr hdd, IntPtr hdc, bool fBackground);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSVFW32_DrawDibRealize' -Namespace Win32 -PassThru
# $api::DrawDibRealize(hdd, hdc, fBackground)
#uselib "MSVFW32.dll"
#func global DrawDibRealize "DrawDibRealize" sptr, sptr, sptr
; DrawDibRealize hdd, hdc, fBackground   ; 戻り値は stat
; hdd : INT_PTR -> "sptr"
; hdc : HDC -> "sptr"
; fBackground : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MSVFW32.dll"
#cfunc global DrawDibRealize "DrawDibRealize" sptr, sptr, int
; res = DrawDibRealize(hdd, hdc, fBackground)
; hdd : INT_PTR -> "sptr"
; hdc : HDC -> "sptr"
; fBackground : BOOL -> "int"
; DWORD DrawDibRealize(INT_PTR hdd, HDC hdc, BOOL fBackground)
#uselib "MSVFW32.dll"
#cfunc global DrawDibRealize "DrawDibRealize" intptr, intptr, int
; res = DrawDibRealize(hdd, hdc, fBackground)
; hdd : INT_PTR -> "intptr"
; hdc : HDC -> "intptr"
; fBackground : BOOL -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
	procDrawDibRealize = msvfw32.NewProc("DrawDibRealize")
)

// hdd (INT_PTR), hdc (HDC), fBackground (BOOL)
r1, _, err := procDrawDibRealize.Call(
	uintptr(hdd),
	uintptr(hdc),
	uintptr(fBackground),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function DrawDibRealize(
  hdd: NativeInt;   // INT_PTR
  hdc: THandle;   // HDC
  fBackground: BOOL   // BOOL
): DWORD; stdcall;
  external 'MSVFW32.dll' name 'DrawDibRealize';
result := DllCall("MSVFW32\DrawDibRealize"
    , "Ptr", hdd   ; INT_PTR
    , "Ptr", hdc   ; HDC
    , "Int", fBackground   ; BOOL
    , "UInt")   ; return: DWORD
●DrawDibRealize(hdd, hdc, fBackground) = DLL("MSVFW32.dll", "dword DrawDibRealize(int, void*, bool)")
# 呼び出し: DrawDibRealize(hdd, hdc, fBackground)
# hdd : INT_PTR -> "int"
# hdc : HDC -> "void*"
# fBackground : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。