using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace ImgDlgSample
{
public enum MousePositionCodes : int
{
HTERROR = -2,
HTTRANSPARENT = -1,
HTNOWHERE = 0,
HTCLIENT = 1,
HTCAPTION = 2,
HTSYSMENU = 3,
HTGROWBOX = 4,
HTSIZE = HTGROWBOX,
HTMENU = 5,
HTHSCROLL = 6,
HTVSCROLL = 7,
HTMINBUTTON = 8,
HTMAXBUTTON = 9,
HTLEFT = 10,
HTRIGHT = 11,
HTTOP = 12,
HTTOPLEFT = 13,
HTTOPRIGHT = 14,
HTBOTTOM = 15,
HTBOTTOMLEFT = 16,
HTBOTTOMRIGHT = 17,
HTBORDER = 18,
HTOBJECT = 19,
HTCLOSE = 20,
HTHELP = 21,
}
public static class BlendOp
{
public const byte AC_SRC_OVER = 0x00;
public const byte AC_SRC_ALPHA = 0x01;
}
/// <summary>
/// BLENDFUNCTION
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct BLENDFUNCTION
{
byte BlendOp;
byte BlendFlags;
byte SourceConstantAlpha;
byte AlphaFormat;
public BLENDFUNCTION(byte op, byte flags, byte alpha, byte format)
{
BlendOp = op;
BlendFlags = flags;
SourceConstantAlpha = alpha;
AlphaFormat = format;
}
}
/// <summary>
/// POINT
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;
public POINT(int x, int y)
{
this.X = x;
this.Y = y;
}
public static implicit operator Point(POINT p)
{
return new Point(p.X, p.Y);
}
public static implicit operator POINT(Point p)
{
return new POINT(p.X, p.Y);
}
}
/// <summary>
/// SIZE
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct SIZE
{
public int cx;
public int cy;
public SIZE(int cx, int cy)
{
this.cx = cx;
this.cy = cy;
}
}
public static class CompressionType
{
public const byte BI_RGB = 0;
public const byte BI_RLE8 = 1;
public const byte BI_RLE4 = 2;
public const byte BI_BITFIELDS = 3;
public const byte BI_JPEG = 4;
public const byte BI_PNG = 5;
}
public static class DIBColorTableIdentifier
{
public const byte DIB_RGB_COLORS = 0;
public const byte DIB_PAL_COLORS = 1;
}
public static class UpdateLayerWindowParameter
{
public const int ULW_COLORKEY = 0x00000001;
public const int ULW_ALPHA = 0x00000002;
public const int ULW_OPAQUE = 0x00000004;
public const int ULW_EX_NORESIZE = 0x00000008;
}
public static class WindowsLong
{
public const int GWL_WNDPROC = -4;
public const int GWL_HINSTANCE = -6;
public const int GWL_HWNDPARENT = -8;
public const int GWL_STYLE = -16;
public const int GWL_EXSTYLE = -20;
public const int GWL_USERDATA = -21;
public const int GWL_ID = -12;
}
}