using System;
using System.Runtime.InteropServices;
namespace linker.libs.winapis;
public static class GDI32
{
#region Enums
///
/// Specifies a raster-operation code. These codes define how the color data for the
/// source rectangle is to be combined with the color data for the destination
/// rectangle to achieve the final color.
///
public enum TernaryRasterOperations : uint
{
/// dest = source
SRCCOPY = 0x00CC0020,
/// dest = source OR dest
SRCPAINT = 0x00EE0086,
/// dest = source AND dest
SRCAND = 0x008800C6,
/// dest = source XOR dest
SRCINVERT = 0x00660046,
/// dest = source AND (NOT dest)
SRCERASE = 0x00440328,
/// dest = (NOT source)
NOTSRCCOPY = 0x00330008,
/// dest = (NOT src) AND (NOT dest)
NOTSRCERASE = 0x001100A6,
/// dest = (source AND pattern)
MERGECOPY = 0x00C000CA,
/// dest = (NOT source) OR dest
MERGEPAINT = 0x00BB0226,
/// dest = pattern
PATCOPY = 0x00F00021,
/// dest = DPSnoo
PATPAINT = 0x00FB0A09,
/// dest = pattern XOR dest
PATINVERT = 0x005A0049,
/// dest = (NOT dest)
DSTINVERT = 0x00550009,
/// dest = BLACK
BLACKNESS = 0x00000042,
/// dest = WHITE
WHITENESS = 0x00FF0062,
///
/// Capture window as seen on screen. This includes layered windows
/// such as WPF windows with AllowsTransparency="true"
///
CAPTUREBLT = 0x40000000
}
#endregion
#region DLL Imports
[DllImport("gdi32.dll", EntryPoint = "BitBlt", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool BitBlt([In] nint hdc, int nXDest, int nYDest, int nWidth, int nHeight, [In] nint hdcSrc, int nXSrc, int nYSrc, TernaryRasterOperations dwRop);
[DllImport("gdi32.dll")]
public static extern nint CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, nint lpInitData);
[DllImport("GDI32.dll")]
public static extern nint CreateCompatibleBitmap(nint hdc, int nWidth, int nHeight); [DllImport("GDI32.dll")]
public static extern nint CreateCompatibleDC(nint hdc);
[DllImport("GDI32.dll")]
public static extern bool DeleteDC(nint hdc);
[DllImport("GDI32.dll")]
public static extern bool DeleteObject(nint hObject);
[DllImport("GDI32.dll")]
public static extern nint GetDeviceCaps(nint hdc, int nIndex);
[DllImport("GDI32.dll")]
public static extern nint SelectObject(nint hdc, nint hgdiobj);
#endregion
}