using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace Yaulw.Win32 { /// /// Gdi32.dll Entry Points * http://pinvoke.net/ * /// public static class Gdi32 { /// /// The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from /// the specified source device context into a destination device context. /// /// A handle to the destination device context /// The x-coordinate, in logical units, of the upper-left corner of the destination rectangle /// The y-coordinate, in logical units, of the upper-left corner of the destination rectangle /// he width, in logical units, of the source and destination rectangles /// The height, in logical units, of the source and the destination rectangles /// A handle to the source device context /// The x-coordinate, in logical units, of the upper-left corner of the source rectangle /// The y-coordinate, in logical units, of the upper-left corner of the source rectangle /// 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 /// If the function succeeds, the return value is nonzero [DllImport("gdi32.dll")] extern public static bool BitBlt(IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, IntPtr hdcSource, int xSrc, int ySrc, int RasterOp); /// /// This function creates a bitmap compatible with the device associated with the specified device context /// /// Handle to a device context /// Specifies the bitmap width, in pixels /// Specifies the bitmap height, in pixels /// A handle to the bitmap indicates success. NULL indicates failure. [DllImport("gdi32.dll")] extern public static IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight); /// /// This function creates a memory device context (DC) compatible with the specified device /// /// Handle to an existing device context /// The handle to a memory device context indicates success. NULL indicates failure. [DllImport("gdi32.dll")] extern public static IntPtr CreateCompatibleDC(IntPtr hdc); /// /// /// /// /// /// /// /// [DllImport("gdi32.dll")] extern public static IntPtr CreateDC(string lpszDriver, IntPtr passNULL, IntPtr passNULL2, IntPtr passNULL3); /// /// /// /// /// [DllImport("gdi32.dll")] extern public static IntPtr DeleteDC(IntPtr hDc); /// /// /// /// /// [DllImport("gdi32.dll")] extern public static IntPtr DeleteObject(IntPtr hDc); /// /// /// /// /// /// [DllImport("gdi32.dll")] extern public static IntPtr SelectObject(IntPtr hdc, IntPtr bmp); } }