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

BitBlt

関数
デバイスコンテキスト間でビットマップのブロック転送を行う。
DLLGDI32.dll呼出規約winapiSetLastErrorあり対応OSWindows 2000 以降

シグネチャ

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

BOOL BitBlt(
    HDC hdc,
    INT x,
    INT y,
    INT cx,
    INT cy,
    HDC hdcSrc,   // optional
    INT x1,
    INT y1,
    ROP_CODE rop
);

パラメーター

名前方向説明
hdcHDCinデスティネーションデバイスコンテキストへのハンドル。
xINTinデスティネーション矩形の左上隅の x 座標 (論理単位)。
yINTinデスティネーション矩形の左上隅の y 座標 (論理単位)。
cxINTinソース矩形およびデスティネーション矩形の幅 (論理単位)。
cyINTinソース矩形およびデスティネーション矩形の高さ (論理単位)。
hdcSrcHDCinoptionalソースデバイスコンテキストへのハンドル。
x1INTinソース矩形の左上隅の x 座標 (論理単位)。
y1INTinソース矩形の左上隅の y 座標 (論理単位)。
ropROP_CODEin

ラスター操作コード。これらのコードは、最終的な色を得るために、ソース矩形の色データをデスティネーション矩形の色データとどのように組み合わせるかを定義します。

次の一覧に、代表的なラスター操作コードを示します。

意味
BLACKNESS
物理パレットのインデックス 0 に関連付けられた色でデスティネーション矩形を塗りつぶします。(既定の物理パレットでは、この色は黒です。)
CAPTUREBLT
自分のウィンドウの上に重ねて表示されているウィンドウも、結果の画像に含めます。既定では、画像には自分のウィンドウのみが含まれます。なお、これは一般に印刷用デバイスコンテキストには使用できません。
DSTINVERT
デスティネーション矩形を反転します。
MERGECOPY
ソース矩形の色を、hdcDest で現在選択されているブラシと、ブール演算 AND を使用して結合します。
MERGEPAINT
反転したソース矩形の色を、デスティネーション矩形の色と、ブール演算 OR を使用して結合します。
NOMIRRORBITMAP
ビットマップが反転 (ミラー化) されるのを防ぎます。
NOTSRCCOPY
反転したソース矩形をデスティネーションにコピーします。
NOTSRCERASE
ソース矩形とデスティネーション矩形の色を、ブール演算 OR を使用して結合し、その結果の色を反転します。
PATCOPY
hdcDest で現在選択されているブラシを、デスティネーションビットマップにコピーします。
PATINVERT
hdcDest で現在選択されているブラシの色を、デスティネーション矩形の色と、ブール演算 XOR を使用して結合します。
PATPAINT
hdcDest で現在選択されているブラシの色を、反転したソース矩形の色と、ブール演算 OR を使用して結合します。その演算結果を、デスティネーション矩形の色と、ブール演算 OR を使用してさらに結合します。
SRCAND
ソース矩形とデスティネーション矩形の色を、ブール演算 AND を使用して結合します。
SRCCOPY
ソース矩形をデスティネーション矩形へ直接コピーします。
SRCERASE
反転したデスティネーション矩形の色を、ソース矩形の色と、ブール演算 AND を使用して結合します。
SRCINVERT
ソース矩形とデスティネーション矩形の色を、ブール演算 XOR を使用して結合します。
SRCPAINT
ソース矩形とデスティネーション矩形の色を、ブール演算 OR を使用して結合します。
WHITENESS
物理パレットのインデックス 1 に関連付けられた色でデスティネーション矩形を塗りつぶします。(既定の物理パレットでは、この色は白です。)

戻り値の型: BOOL

公式ドキュメント

BitBlt 関数は、指定したソースデバイスコンテキストからピクセルの矩形に対応する色データを、ビットブロック転送 (bit-block transfer) によってデスティネーションデバイスコンテキストへ転送します。

戻り値

関数が成功した場合、戻り値は 0 以外の値です。

関数が失敗した場合、戻り値は 0 です。拡張エラー情報を取得するには、GetLastError を呼び出してください。

解説(Remarks)

BitBlt はデスティネーション DC に対してのみクリッピングを行います。

ソースデバイスコンテキストに回転またはせん断 (shear) 変換が適用されている場合、BitBlt はエラーを返します。ソースデバイスコンテキストにその他の変換が適用されている (かつ、対応する変換がデスティネーションデバイスコンテキストに適用されていない) 場合、デスティネーションデバイスコンテキスト内の矩形は、必要に応じて拡大、縮小、または回転されます。

ソースデバイスコンテキストとデスティネーションデバイスコンテキストの色形式が一致しない場合、BitBlt 関数はソースの色形式をデスティネーションの形式に合わせて変換します。

拡張メタファイルの記録中に、ソースデバイスコンテキストが拡張メタファイルデバイスコンテキストを指定している場合は、エラーが発生します。

すべてのデバイスが BitBlt 関数をサポートしているわけではありません。詳細については、GetDeviceCaps 関数の RC_BITBLT ラスター機能エントリ、および次の各関数を参照してください: MaskBltPlgBltStretchBlt

ソースデバイスコンテキストとデスティネーションデバイスコンテキストが異なるデバイスを表している場合、BitBlt はエラーを返します。異なるデバイスの DC 間でデータを転送するには、GetDIBits を呼び出してメモリビットマップを DIB に変換します。その DIB を 2 番目のデバイスに表示するには、SetDIBits または StretchDIBits を呼び出します。

ICM: ブリット (blit) 時にはカラーマネジメントは行われません。

次のコード例は、BitBlt の使用方法を示しています。

if (!BitBlt(hdcMemDC,
    0, 0,
    rcClient.right - rcClient.left, rcClient.bottom - rcClient.top,
    hdcWindow,
    0, 0,
    SRCCOPY))
{
    MessageBox(hWnd, L"BitBlt has failed", L"Failed", MB_OK);
    goto done;
}

この例を実際の文脈の中で確認するには、Capturing an Image を参照してください。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

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

BOOL BitBlt(
    HDC hdc,
    INT x,
    INT y,
    INT cx,
    INT cy,
    HDC hdcSrc,   // optional
    INT x1,
    INT y1,
    ROP_CODE rop
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool BitBlt(
    IntPtr hdc,   // HDC
    int x,   // INT
    int y,   // INT
    int cx,   // INT
    int cy,   // INT
    IntPtr hdcSrc,   // HDC optional
    int x1,   // INT
    int y1,   // INT
    uint rop   // ROP_CODE
);
<DllImport("GDI32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function BitBlt(
    hdc As IntPtr,   ' HDC
    x As Integer,   ' INT
    y As Integer,   ' INT
    cx As Integer,   ' INT
    cy As Integer,   ' INT
    hdcSrc As IntPtr,   ' HDC optional
    x1 As Integer,   ' INT
    y1 As Integer,   ' INT
    rop As UInteger   ' ROP_CODE
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' hdc : HDC
' x : INT
' y : INT
' cx : INT
' cy : INT
' hdcSrc : HDC optional
' x1 : INT
' y1 : INT
' rop : ROP_CODE
Declare PtrSafe Function BitBlt Lib "gdi32" ( _
    ByVal hdc As LongPtr, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal cx As Long, _
    ByVal cy As Long, _
    ByVal hdcSrc As LongPtr, _
    ByVal x1 As Long, _
    ByVal y1 As Long, _
    ByVal rop As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

BitBlt = ctypes.windll.gdi32.BitBlt
BitBlt.restype = wintypes.BOOL
BitBlt.argtypes = [
    wintypes.HANDLE,  # hdc : HDC
    ctypes.c_int,  # x : INT
    ctypes.c_int,  # y : INT
    ctypes.c_int,  # cx : INT
    ctypes.c_int,  # cy : INT
    wintypes.HANDLE,  # hdcSrc : HDC optional
    ctypes.c_int,  # x1 : INT
    ctypes.c_int,  # y1 : INT
    wintypes.DWORD,  # rop : ROP_CODE
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('GDI32.dll')
BitBlt = Fiddle::Function.new(
  lib['BitBlt'],
  [
    Fiddle::TYPE_VOIDP,  # hdc : HDC
    Fiddle::TYPE_INT,  # x : INT
    Fiddle::TYPE_INT,  # y : INT
    Fiddle::TYPE_INT,  # cx : INT
    Fiddle::TYPE_INT,  # cy : INT
    Fiddle::TYPE_VOIDP,  # hdcSrc : HDC optional
    Fiddle::TYPE_INT,  # x1 : INT
    Fiddle::TYPE_INT,  # y1 : INT
    -Fiddle::TYPE_INT,  # rop : ROP_CODE
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdi32")]
extern "system" {
    fn BitBlt(
        hdc: *mut core::ffi::c_void,  // HDC
        x: i32,  // INT
        y: i32,  // INT
        cx: i32,  // INT
        cy: i32,  // INT
        hdcSrc: *mut core::ffi::c_void,  // HDC optional
        x1: i32,  // INT
        y1: i32,  // INT
        rop: u32  // ROP_CODE
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", SetLastError = true)]
public static extern bool BitBlt(IntPtr hdc, int x, int y, int cx, int cy, IntPtr hdcSrc, int x1, int y1, uint rop);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_BitBlt' -Namespace Win32 -PassThru
# $api::BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
#uselib "GDI32.dll"
#func global BitBlt "BitBlt" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; BitBlt hdc, x, y, cx, cy, hdcSrc, x1, y1, rop   ; 戻り値は stat
; hdc : HDC -> "sptr"
; x : INT -> "sptr"
; y : INT -> "sptr"
; cx : INT -> "sptr"
; cy : INT -> "sptr"
; hdcSrc : HDC optional -> "sptr"
; x1 : INT -> "sptr"
; y1 : INT -> "sptr"
; rop : ROP_CODE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "GDI32.dll"
#cfunc global BitBlt "BitBlt" sptr, int, int, int, int, sptr, int, int, int
; res = BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
; hdc : HDC -> "sptr"
; x : INT -> "int"
; y : INT -> "int"
; cx : INT -> "int"
; cy : INT -> "int"
; hdcSrc : HDC optional -> "sptr"
; x1 : INT -> "int"
; y1 : INT -> "int"
; rop : ROP_CODE -> "int"
; BOOL BitBlt(HDC hdc, INT x, INT y, INT cx, INT cy, HDC hdcSrc, INT x1, INT y1, ROP_CODE rop)
#uselib "GDI32.dll"
#cfunc global BitBlt "BitBlt" intptr, int, int, int, int, intptr, int, int, int
; res = BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
; hdc : HDC -> "intptr"
; x : INT -> "int"
; y : INT -> "int"
; cx : INT -> "int"
; cy : INT -> "int"
; hdcSrc : HDC optional -> "intptr"
; x1 : INT -> "int"
; y1 : INT -> "int"
; rop : ROP_CODE -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdi32 = windows.NewLazySystemDLL("GDI32.dll")
	procBitBlt = gdi32.NewProc("BitBlt")
)

// hdc (HDC), x (INT), y (INT), cx (INT), cy (INT), hdcSrc (HDC optional), x1 (INT), y1 (INT), rop (ROP_CODE)
r1, _, err := procBitBlt.Call(
	uintptr(hdc),
	uintptr(x),
	uintptr(y),
	uintptr(cx),
	uintptr(cy),
	uintptr(hdcSrc),
	uintptr(x1),
	uintptr(y1),
	uintptr(rop),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function BitBlt(
  hdc: THandle;   // HDC
  x: Integer;   // INT
  y: Integer;   // INT
  cx: Integer;   // INT
  cy: Integer;   // INT
  hdcSrc: THandle;   // HDC optional
  x1: Integer;   // INT
  y1: Integer;   // INT
  rop: DWORD   // ROP_CODE
): BOOL; stdcall;
  external 'GDI32.dll' name 'BitBlt';
result := DllCall("GDI32\BitBlt"
    , "Ptr", hdc   ; HDC
    , "Int", x   ; INT
    , "Int", y   ; INT
    , "Int", cx   ; INT
    , "Int", cy   ; INT
    , "Ptr", hdcSrc   ; HDC optional
    , "Int", x1   ; INT
    , "Int", y1   ; INT
    , "UInt", rop   ; ROP_CODE
    , "Int")   ; return: BOOL
●BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop) = DLL("GDI32.dll", "bool BitBlt(void*, int, int, int, int, void*, int, int, dword)")
# 呼び出し: BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
# hdc : HDC -> "void*"
# x : INT -> "int"
# y : INT -> "int"
# cx : INT -> "int"
# cy : INT -> "int"
# hdcSrc : HDC optional -> "void*"
# x1 : INT -> "int"
# y1 : INT -> "int"
# rop : ROP_CODE -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "gdi32" fn BitBlt(
    hdc: ?*anyopaque, // HDC
    x: i32, // INT
    y: i32, // INT
    cx: i32, // INT
    cy: i32, // INT
    hdcSrc: ?*anyopaque, // HDC optional
    x1: i32, // INT
    y1: i32, // INT
    rop: u32 // ROP_CODE
) callconv(std.os.windows.WINAPI) i32;
proc BitBlt(
    hdc: pointer,  # HDC
    x: int32,  # INT
    y: int32,  # INT
    cx: int32,  # INT
    cy: int32,  # INT
    hdcSrc: pointer,  # HDC optional
    x1: int32,  # INT
    y1: int32,  # INT
    rop: uint32  # ROP_CODE
): int32 {.importc: "BitBlt", stdcall, dynlib: "GDI32.dll".}
pragma(lib, "gdi32");
extern(Windows)
int BitBlt(
    void* hdc,   // HDC
    int x,   // INT
    int y,   // INT
    int cx,   // INT
    int cy,   // INT
    void* hdcSrc,   // HDC optional
    int x1,   // INT
    int y1,   // INT
    uint rop   // ROP_CODE
);
ccall((:BitBlt, "GDI32.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Int32, Int32, Int32, Int32, Ptr{Cvoid}, Int32, Int32, UInt32),
      hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
# hdc : HDC -> Ptr{Cvoid}
# x : INT -> Int32
# y : INT -> Int32
# cx : INT -> Int32
# cy : INT -> Int32
# hdcSrc : HDC optional -> Ptr{Cvoid}
# x1 : INT -> Int32
# y1 : INT -> Int32
# rop : ROP_CODE -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t BitBlt(
    void* hdc,
    int32_t x,
    int32_t y,
    int32_t cx,
    int32_t cy,
    void* hdcSrc,
    int32_t x1,
    int32_t y1,
    uint32_t rop);
]]
local gdi32 = ffi.load("gdi32")
-- gdi32.BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
-- hdc : HDC
-- x : INT
-- y : INT
-- cx : INT
-- cy : INT
-- hdcSrc : HDC optional
-- x1 : INT
-- y1 : INT
-- rop : ROP_CODE
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('GDI32.dll');
const BitBlt = lib.func('__stdcall', 'BitBlt', 'int32_t', ['void *', 'int32_t', 'int32_t', 'int32_t', 'int32_t', 'void *', 'int32_t', 'int32_t', 'uint32_t']);
// BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
// hdc : HDC -> 'void *'
// x : INT -> 'int32_t'
// y : INT -> 'int32_t'
// cx : INT -> 'int32_t'
// cy : INT -> 'int32_t'
// hdcSrc : HDC optional -> 'void *'
// x1 : INT -> 'int32_t'
// y1 : INT -> 'int32_t'
// rop : ROP_CODE -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("GDI32.dll", {
  BitBlt: { parameters: ["pointer", "i32", "i32", "i32", "i32", "pointer", "i32", "i32", "u32"], result: "i32" },
});
// lib.symbols.BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)
// hdc : HDC -> "pointer"
// x : INT -> "i32"
// y : INT -> "i32"
// cx : INT -> "i32"
// cy : INT -> "i32"
// hdcSrc : HDC optional -> "pointer"
// x1 : INT -> "i32"
// y1 : INT -> "i32"
// rop : ROP_CODE -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t BitBlt(
    void* hdc,
    int32_t x,
    int32_t y,
    int32_t cx,
    int32_t cy,
    void* hdcSrc,
    int32_t x1,
    int32_t y1,
    uint32_t rop);
C, "GDI32.dll");
// $ffi->BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop);
// hdc : HDC
// x : INT
// y : INT
// cx : INT
// cy : INT
// hdcSrc : HDC optional
// x1 : INT
// y1 : INT
// rop : ROP_CODE
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Gdi32 extends StdCallLibrary {
    Gdi32 INSTANCE = Native.load("gdi32", Gdi32.class);
    boolean BitBlt(
        Pointer hdc,   // HDC
        int x,   // INT
        int y,   // INT
        int cx,   // INT
        int cy,   // INT
        Pointer hdcSrc,   // HDC optional
        int x1,   // INT
        int y1,   // INT
        int rop   // ROP_CODE
    );
}
@[Link("gdi32")]
lib LibGDI32
  fun BitBlt = BitBlt(
    hdc : Void*,   # HDC
    x : Int32,   # INT
    y : Int32,   # INT
    cx : Int32,   # INT
    cy : Int32,   # INT
    hdcSrc : Void*,   # HDC optional
    x1 : Int32,   # INT
    y1 : Int32,   # INT
    rop : UInt32   # ROP_CODE
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef BitBltNative = Int32 Function(Pointer<Void>, Int32, Int32, Int32, Int32, Pointer<Void>, Int32, Int32, Uint32);
typedef BitBltDart = int Function(Pointer<Void>, int, int, int, int, Pointer<Void>, int, int, int);
final BitBlt = DynamicLibrary.open('GDI32.dll')
    .lookupFunction<BitBltNative, BitBltDart>('BitBlt');
// hdc : HDC -> Pointer<Void>
// x : INT -> Int32
// y : INT -> Int32
// cx : INT -> Int32
// cy : INT -> Int32
// hdcSrc : HDC optional -> Pointer<Void>
// x1 : INT -> Int32
// y1 : INT -> Int32
// rop : ROP_CODE -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function BitBlt(
  hdc: THandle;   // HDC
  x: Integer;   // INT
  y: Integer;   // INT
  cx: Integer;   // INT
  cy: Integer;   // INT
  hdcSrc: THandle;   // HDC optional
  x1: Integer;   // INT
  y1: Integer;   // INT
  rop: DWORD   // ROP_CODE
): BOOL; stdcall;
  external 'GDI32.dll' name 'BitBlt';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "BitBlt"
  c_BitBlt :: Ptr () -> Int32 -> Int32 -> Int32 -> Int32 -> Ptr () -> Int32 -> Int32 -> Word32 -> IO CInt
-- hdc : HDC -> Ptr ()
-- x : INT -> Int32
-- y : INT -> Int32
-- cx : INT -> Int32
-- cy : INT -> Int32
-- hdcSrc : HDC optional -> Ptr ()
-- x1 : INT -> Int32
-- y1 : INT -> Int32
-- rop : ROP_CODE -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let bitblt =
  foreign "BitBlt"
    ((ptr void) @-> int32_t @-> int32_t @-> int32_t @-> int32_t @-> (ptr void) @-> int32_t @-> int32_t @-> uint32_t @-> returning int32_t)
(* hdc : HDC -> (ptr void) *)
(* x : INT -> int32_t *)
(* y : INT -> int32_t *)
(* cx : INT -> int32_t *)
(* cy : INT -> int32_t *)
(* hdcSrc : HDC optional -> (ptr void) *)
(* x1 : INT -> int32_t *)
(* y1 : INT -> int32_t *)
(* rop : ROP_CODE -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library gdi32 (t "GDI32.dll"))
(cffi:use-foreign-library gdi32)

(cffi:defcfun ("BitBlt" bit-blt :convention :stdcall) :int32
  (hdc :pointer)   ; HDC
  (x :int32)   ; INT
  (y :int32)   ; INT
  (cx :int32)   ; INT
  (cy :int32)   ; INT
  (hdc-src :pointer)   ; HDC optional
  (x1 :int32)   ; INT
  (y1 :int32)   ; INT
  (rop :uint32))   ; ROP_CODE
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $BitBlt = Win32::API::More->new('GDI32',
    'BOOL BitBlt(HANDLE hdc, int x, int y, int cx, int cy, HANDLE hdcSrc, int x1, int y1, DWORD rop)');
# my $ret = $BitBlt->Call($hdc, $x, $y, $cx, $cy, $hdcSrc, $x1, $y1, $rop);
# hdc : HDC -> HANDLE
# x : INT -> int
# y : INT -> int
# cx : INT -> int
# cy : INT -> int
# hdcSrc : HDC optional -> HANDLE
# x1 : INT -> int
# y1 : INT -> int
# rop : ROP_CODE -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

公式の関連項目
使用する型