Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "1" in [All]

gdi32

.

const int AC_SRC_ALPHA = 0x01;

.

const byte AC_SRC_ALPHA = 0x01;

2: Arc
.

   int nRightRect, int nBottomRect, int nXRadial1, int nYRadial1,

.

  ByVal nXRadial1 As Integer, ByVal nYRadial1 As Integer, _

.

   int nRightRect, int nBottomRect, int nXRadial1, int nYRadial1,

.

  ByVal nXRadial1 As Integer, ByVal nYRadial1 As Integer, _

.

            IntPtr        dc1;

.

            dc1=g.GetHdc();

.

            BitBlt(dc1, 0, 0, c.Width, c.Height, dc2, 0, 0, 13369376);

.

            g.ReleaseHdc(dc1);

.

    NOTSRCERASE = 0x001100A6,

.

    PATCOPY     = 0x00F00021,

.

   int nRightRect, int nBottomRect, int nXRadial1, int nYRadial1,

.

               ByVal nRightRect As Integer, ByVal nBottomRect As Integer, ByVal nXRadial1 As Integer,

.

               ByVal nYRadial1 As Integer, ByVal nXRadial2 As Integer, ByVal nYRadial2 As Integer) As Boolean

.

static extern int CombineRgn(IntPtr hrgnDest, IntPtr hrgnSrc1,

.

   ByVal hrgnSrc1 As IntPtr, ByVal hrgnSrc2 As IntPtr,

.

    RGN_AND         =1,

.

public const int NULLREGION = 1;

.

    static extern System.UInt16  SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool bRedraw);

.

    static extern int CombineRgn(IntPtr hrgnDest, IntPtr hrgnSrc1,IntPtr hrgnSrc2, int fnCombineMode);

.

            IntPtr r1 = CreateEllipticRgn(0,0,300,300);

.

            IntPtr r2 = CreateEllipticRgn(100,100,300,300);

.

            IntPtr r3= CreateEllipticRgn(100,100,300,300);

.

            CombineRgn(r3,r1,r2,0);

.

Please note that this API method needs to be called twice! 1st to get the size of the enh meta file and 2nd to fill the buffer.

.

    public partial class Form1 : Form

.

    public Form1()

.

    private void timer1_Tick(object sender, EventArgs e)

.

        for (int x = 0; x < 1000; x += 5)

.

        for (int y = 0; y < 1000; y += 5)

.
    • An array of 16-bit unsigned integers that specifies indexes into the currently realized logical palette.
.

Public Shared Function CreateEllipticRgn(ByVal X1 As Integer, ByVal Y1 As Integer, ByVal witdth As Integer, ByVal Height As Integer) As Integer

.

Declaration from MSDN (http://msdn2.microsoft.com/en-us/library/aa288468(vs.71).aspx) is OK :

.

This parameter is ignored and should be set to NULL. It is provided only for compatibility with 16-bit Windows.

.

Values for fnPolyFillMode can be 1=Alternate or 2=Winding

.

    IntPtr forma = CreatePolygonRgn(edges, edges.Length, 1);

.

static extern IntPtr CreateRoundRectRgn(int x1, int y1, int x2, int y2,

.

        IntPtr _RegionHandle = CreateRoundRectRgn( 10, 10, 60, 60, 10, 10 );

.

                    if (CreateScalableFontResourceA(1,

.

    private const byte DEFAULT_CHARSET = 1;

.

    private const byte SHIFTJIS_CHARSET = 128;

.

    private const byte JOHAB_CHARSET = 130;

.

    private const byte FIXED_PITCH = 1;

.

    private const byte FF_ROMAN = (1 << 4);

.

        del1 = new EnumFontExDelegate(callback1);

.

        ret = EnumFontFamiliesEx(ptr, plogFont, del1, IntPtr.Zero, 0);

.

    [MarshalAs(UnmanagedType.U1)]

.

    [MarshalAs(UnmanagedType.U1)]

.

    [MarshalAs(UnmanagedType.U1)]

.

    FW_THIN = 100,

.

    DEFAULT_CHARSET = 1,

.

    SHIFTJIS_CHARSET = 128,

.

    HANGEUL_CHARSET = 129,

.

    HANGUL_CHARSET = 129,

.

    GB2312_CHARSET = 134,

.

    CHINESEBIG5_CHARSET = 136,

.

    JOHAB_CHARSET = 130,

.

    HEBREW_CHARSET = 177,

.

    ARABIC_CHARSET = 178,

.

    GREEK_CHARSET = 161,

.

    TURKISH_CHARSET = 162,

.

    VIETNAMESE_CHARSET = 163,

.

    BALTIC_CHARSET = 186,

.

    OUT_STRING_PRECIS = 1,

.

    OUT_PS_ONLY_PRECIS = 10,

.

    CLIP_CHARACTER_PRECIS = 1,

.

    CLIP_LH_ANGLES = (1 << 4),

.

    DRAFT_QUALITY = 1,

.

    FIXED_PITCH = 1,

.

    FF_ROMAN = (1 << 4),

.

    public EnumFontExDelegate del1;

.

    public int callback1(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int FontType, int lParam)

.

    return 1;

.

    Unknown = 1,

.

Sample Code: (Tested on Windows 8.1 Professional 64 Bit)

.

        /// #define RASTER_FONTTYPE     0x0001

.

            RASTER_FONTTYPE = 0x0001,

.

        /// #define FW_THIN         100

.

            FW_THIN = 100,

.

        /// #define FIXED_PITCH         1

.

            FIXED_PITCH = 1,

.

        /// #define FF_ROMAN        (1<<4)  Variable stroke width, serifed.

.

            FF_ROMAN = 1 << 4,

.

        /// #define MM_TEXT         1

.

            MM_TEXT = 1,

.

            DEFAULT_CHARSET = 0x00000001,

.

            HANGUL_CHARSET = 0x00000081,

.

            GB2312_CHARSET = 0x00000086,

.

            GREEK_CHARSET = 0x000000A1,

.

            HEBREW_CHARSET = 0x000000B1,

.

            return 1;

.

    private const byte DEFAULT_CHARSET = 1;

.

    private const byte SHIFTJIS_CHARSET = 128;

.

    private const byte JOHAB_CHARSET = 130;

.

    private const byte FIXED_PITCH = 1;

.

    private const byte FF_ROMAN = (1 << 4);

.

        del1 = new EnumFontExDelegate(callback1);

.

        ret = EnumFontFamiliesEx(ptr, plogFont, del1, IntPtr.Zero, 0);

.

    [MarshalAs(UnmanagedType.U1)]

.

    [MarshalAs(UnmanagedType.U1)]

.

    [MarshalAs(UnmanagedType.U1)]

.

    FW_THIN = 100,

.

    DEFAULT_CHARSET = 1,

.

    SHIFTJIS_CHARSET = 128,

.

    HANGEUL_CHARSET = 129,

.

    HANGUL_CHARSET = 129,

.

    GB2312_CHARSET = 134,

.

    CHINESEBIG5_CHARSET = 136,

.

    JOHAB_CHARSET = 130,

.

    HEBREW_CHARSET = 177,

.

    ARABIC_CHARSET = 178,

.

    GREEK_CHARSET = 161,

.

    TURKISH_CHARSET = 162,

.

    VIETNAMESE_CHARSET = 163,

.

    BALTIC_CHARSET = 186,

.

    OUT_STRING_PRECIS = 1,

.

    OUT_PS_ONLY_PRECIS = 10,

.

    CLIP_CHARACTER_PRECIS = 1,

.

    CLIP_LH_ANGLES = (1 << 4),

.

    DRAFT_QUALITY = 1,

.

    FIXED_PITCH = 1,

.

    FF_ROMAN = (1 << 4),

.

    public EnumFontExDelegate del1;

.

    public int callback1(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int FontType, int lParam)

.

    return 1;

.

    Unknown = 1,

.

        /// #define RASTER_FONTTYPE     0x0001

.

            RASTER_FONTTYPE = 0x0001,

.

        /// #define FW_THIN         100

.

            FW_THIN = 100,

.

        /// #define FIXED_PITCH         1

.

            FIXED_PITCH = 1,

.

        /// #define FF_ROMAN        (1<<4)  Variable stroke width, serifed.

.

            FF_ROMAN = 1 << 4,

.

        /// #define MM_TEXT         1

.

            MM_TEXT = 1,

.

            DEFAULT_CHARSET = 0x00000001,

.

            HANGUL_CHARSET = 0x00000081,

.

            GB2312_CHARSET = 0x00000086,

.

            GREEK_CHARSET = 0x000000A1,

.

            HEBREW_CHARSET = 0x000000B1,

.

            return 1;

.

        static Int32 POSTSCRIPT_PASSTHROUGH     =     4115;

.

        static Int32 ENCAPSULATED_POSTSCRIPT= 4116;

.

        static Int32 POSTSCRIPT_IDENTIFY    =     4117;

.

        static Int32 POSTSCRIPT_INJECTION       =     4118;

.

//insert by Zswang(wjhu111#21cn.com) at 2007-05-22

.

public static uint FLOODFILLSURFACE = 1;

.

private void button1_Click(object sender, EventArgs e)

.

    ExtFloodFill(vDC, 10, 10, GetPixel(vDC, 10, 10), FLOODFILLSURFACE);

.

            ETO_GLYPH_INDEX = 0x10,

.

            ETO_IGNORELANGUAGE = 0x1000,

.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_12zw.asp

.
Summary
TODO - GdipLoadImageFromFile loads an image about 100x faster than System.Drawing because it does not perform any image validation.
.

    TRANSPARENT = 1

.

     ABCFloat[] values = new ABCFloat[end - start + 1];

.

        GCP_DBCS = 0x0001,

.

        GCP_GLYPHSHAPE = 0x0010,

.

        GCP_DIACRITIC = 0x0100,

.

        GCP_JUSTIFY = 0x00010000,

.

        GCP_MAXEXTENT = 0x00100000,

.

        GCP_NUMERICOVERRIDE = 0x01000000,

.

     NullRegion = 1,

.

OBJ_PEN = 1,

.

OBJ_MEMDC = 10,

.

OBJ_EXTPEN = 11,

.

OBJ_ENHMETADC = 12,

.

OBJ_ENHMETAFILE = 13

28: GetDC
.

MoveToEx(dc,10,23,IntPtr.Zero);

.

LineTo(100,300);

.

        VERTRES = 10,

.

        BITSPIXEL = 12,

.

        PLANES = 14,

.

        NUMBRUSHES = 16,

.

        NUMPENS = 18,

.

        SIZEPALETTE = 104,

.

        NUMRESERVED = 106,

.

        COLORRES = 108,

.

        PHYSICALWIDTH = 110,

.

        PHYSICALHEIGHT = 111,

.

        PHYSICALOFFSETX = 112,

.

        PHYSICALOFFSETY = 113,

.

        SCALINGFACTORX = 114,

.

        SCALINGFACTORY = 115,

.

        VREFRESH = 116,

.

        DESKTOPVERTRES = 117,

.

        DESKTOPHORZRES = 118,

.

        BLTALIGNMENT = 119

.

    VERTRES = 10

.

    BITSPIXEL = 12

.

    PLANES = 14

.

    NUMBRUSHES = 16

.

    NUMPENS = 18

.

    SIZEPALETTE = 104

.

    NUMRESERVED = 106

.

    COLORRES = 108

.

    PHYSICALWIDTH = 110

.

    PHYSICALHEIGHT = 111

.

    PHYSICALOFFSETX = 112

.

    PHYSICALOFFSETY = 113

.

    SCALINGFACTORX = 114

.

    SCALINGFACTORY = 115

.

    VREFRESH = 116

.

    DESKTOPVERTRES = 117

.

    DESKTOPHORZRES = 118

.

    BLTALIGNMENT = 119

.

            Console.WriteLine(string.Format("{0}: {1}", cap, result));

.

                Console.WriteLine(String.Format("{0}: {1}", cap, result))

.

        public UInt16[] Red;

.

        public UInt16[] Green;

.

        public UInt16[] Blue;

. .

            uint table = 0x656D616E    // represents char sequence 'eman'

.

    /// <code>uint table = 0x656D616E</code>, represents the font table keyword character sequence 'name' in reversed order (i.e. 'eman').</param>

.

    private static uint nameTableKey = 0x656D616E;   // Represents the ASCII character sequence 'eman' => reversed name table key 'name'

.

        ushort selector = ToLittleEndian(br.ReadUInt16());

.

        ushort records = ToLittleEndian(br.ReadUInt16());

.

        ushort offset = ToLittleEndian(br.ReadUInt16());

.

        using (Graphics g = Graphics.FromImage(new Bitmap(1, 1)))

.

        return BitConverter.ToUInt16(bytes, 0);

.

    /// Converts the raw bytes to a <see cref="string"/> by using UTF-16BE Encoding (code page 1201).

.

        // Use UTF-16BE (Unicode big endian) code page

.

        return Encoding.GetEncoding(1201).GetString(bytes);

.

            // encodingId = 1 => Unicode BMP (UCS-2)

.

            return platformId == 3 && encodingId == 1 && nameId == 4;

.

        // Read the unsigned 16-bit integers and convert to little endian

.

        platformId = ToLittleEndian(br.ReadUInt16());

.

        encodingId = ToLittleEndian(br.ReadUInt16());

.

        languageId = ToLittleEndian(br.ReadUInt16());

.

        nameId = ToLittleEndian(br.ReadUInt16());

.

        NameLength = ToLittleEndian(br.ReadUInt16());

.

        ByteOffset = ToLittleEndian(br.ReadUInt16());

.

        return string.Format("NameRecord - Key; Platform ID = {0}, Encoding ID = {1}, Name ID = {2}",

.

        public UInt16 Low;

.

        public UInt16 High;

.

        int count = Marshal.ReadInt32(glyphSet, 12);

.

        range.Low = (UInt16)Marshal.ReadInt16(glyphSet, 16 + i * 4);

.

        range.High = (UInt16)(range.Low + Marshal.ReadInt16(glyphSet, 18 + i * 4) - 1);

.

    [MarshalAs(UnmanagedType.Struct)] public FIXED eM11;

.

    [MarshalAs(UnmanagedType.Struct)] public FIXED eM12;

.

    [MarshalAs(UnmanagedType.Struct)] public FIXED eM21;

.

            matrix.eM11.value = 1;

.

            matrix.eM12.value = 0;

.

            matrix.eM21.value = 0;

.

            matrix.eM22.value = 1;

.

            using(Bitmap b = new Bitmap(1,1))

.

                                    if(curveHeader.wType == (int)1)

.

                                        for(int i=0; i < curveHeader.cpfx - 1; i++)

.

                                            POINTFX pfxC = curvePoints[i+1];

.

Image.FromHbitmap Documentation on MSDN: https://msdn.microsoft.com/en-us/library/k061we7x

.
Warning
The OUTLINETEXTMETRIC structure includes a TEXTMETRIC structure which includes some TCHAR fields. A TCHAR can compile to a 16 bit character or a 8 bit character (depending on whether UNICODE is defined). The C# version of the TEXTMETRIC structure on PInvoke.net assumes that the TCHAR is a 16 bit character and when you retrieve a TEXTMETRIC structure with GetTextMetrics you do get a TEXTMETRIC structure with 16 bit characters. However, when you retrive an OUTLINETEXTMETRIC structure with GetOutlineTextMetrics the included TEXTMETRIC structure appears to have 8 bit characters. (These observations were with Windows XP and might not hold true for other operating systems or all fonts.)
.

        (cr & 0x00FF0000) >> 16);

.

                    (int)(pixel & 0x00FF0000) >> 16);

.

  const int RDH_RECTANGLES = 1;

.

    LTGRAY_BRUSH    = 1,

.

    OEM_FIXED_FONT  = 10,

.

    ANSI_FIXED_FONT = 11,

.

    ANSI_VAR_FONT   = 12,

.

    SYSTEM_FONT     = 13,

.

    DEVICE_DEFAULT_FONT = 14,

.

    DEFAULT_PALETTE     = 15,

.

    SYSTEM_FIXED_FONT   = 16,

.

    DEFAULT_GUI_FONT    = 17,

.

    DC_BRUSH    = 18,

.

    DC_PEN      = 19,

.

    LTGRAY_BRUSH = 1

.

    OEM_FIXED_FONT = 10

.

    ANSI_FIXED_FONT = 11

.

    ANSI_VAR_FONT = 12

.

    SYSTEM_FONT = 13

.

    DEVICE_DEFAULT_FONT = 14

.

    DEFAULT_PALETTE = 15

.

    SYSTEM_FIXED_FONT = 16

.

    DEFAULT_GUI_FONT = 17

.

    DC_BRUSH = 18

.

    DC_PEN = 19

.

Graphics.MeasureString Method (String, Font, SizeF, StringFormat, out Int32, out Int32) http://msdn.microsoft.com/en-us/library/957webty(v=VS.100).aspx

40: GM_
.

    ///   Sets the graphics mode that is compatible with 16-bit Windows. This is the default mode. If

.

    public const int GM_COMPATIBLE = 0x1;

.

      ///   Sets the graphics mode that is compatible with 16-bit Windows. This is the default mode. If

.

      GM_COMPATIBLE = 1,

.
NOTE
GradientFill uses colors of 64 bits, i.e. 16 bits per component (16 bits each for the red, for the green, for the blue and for the alpha), so the type of R, G and B fields in the TRIVERTEX struct are ushort, and not byte.
.

   MM_TEXT = 1,

43: MWT_
.

      MWT_IDENTITY = 1,

44: Pie
.

   int nBottomRect, int nXRadial1, int nYRadial1, int nXRadial2, int nYRadial2);

.

   Private Shared Function Pie(hdc As IntPtr, nLeftRect%, nTopRect%, nRightRect%, nBottomRect%, nXRadial1%, nYRadial1%, nXRadial2%, nYRadial2%) As Boolean

.

    private static IntPtr HWND_BOTTOM = new IntPtr(1);

.

    private static IntPtr HWND_TOPMOST = new IntPtr(-1);

.

        FileInfo fontFile = new FileInfo(args[1]);

.

            AddFontResource(args[1]);

.

            RemoveFontResource(args[1]);

.

private const int MM_TEXT         = 1;

.

        IntPtr thePen = GDI32.CreatePen(0, 1, (uint)GDI32.RGB(Color.White));

.

int AD_COUNTERCLOCKWISE = 1