Exemple #1
0
        public static bool GetTextExtentPoint32(IntPtr DC, string S, int Count, ref Size Size)
        {
            GdiSize size1 = new GdiSize(0, 0);
            bool    flag1 = Win32.GetTextExtentPoint32(DC, S, Count, ref size1);

            Size.Width  = size1.cx;
            Size.Height = size1.cy;
            return(flag1);
        }
Exemple #2
0
        public static bool SetViewportExtEx(IntPtr DC, int nXExtent, int nYExtent, ref Size size)
        {
            GdiSize size1 = new GdiSize(size.Width, size.Height);
            bool    flag1 = Win32.SetViewportExtEx(DC, nXExtent, nYExtent, ref size1);

            size.Width  = size1.cx;
            size.Height = size1.cy;
            return(flag1);
        }
Exemple #3
0
        public static bool ScaleViewportExtEx(IntPtr DC, int Xnum, int Xdenom, int Ynum, int Ydenom, ref Size size)
        {
            GdiSize size1 = new GdiSize(size.Width, size.Height);
            bool    flag1 = Win32.ScaleViewportExtEx(DC, Xnum, Xdenom, Ynum, Ydenom, ref size1);

            size.Width  = size1.cx;
            size.Height = size1.cy;
            return(flag1);
        }
Exemple #4
0
        public static bool GetTextExtentPoint32(IntPtr hdc, string s, int count, ref Size size)
        {
            GdiSize size2 = new GdiSize(0, 0);

            bool flag = GetTextExtentPoint32(hdc, s, count, ref size2);

            size.Width  = size2.cx;
            size.Height = size2.cy;
            return(flag);
        }
Exemple #5
0
        public static bool GetTextExtentExPoint(IntPtr hdc, string s, int len, ref int[] buffer, ref Size size)
        {
            bool   flag  = true;
            IntPtr alpDx = Marshal.AllocHGlobal((int)(buffer.Length * 4));

            try {
                GdiSize size2 = new GdiSize();
                flag = GetTextExtentExPoint(hdc, s, len, 0, IntPtr.Zero, alpDx, ref size2);
                for (int i = 0; i < buffer.Length; i++)
                {
                    buffer[i] = Marshal.ReadInt32(alpDx, i * 4);
                }
                size = size2.ToSize();
            } finally {
                Marshal.FreeHGlobal(alpDx);
            }
            return(flag);
        }
Exemple #6
0
 private static extern bool SetViewportExtEx(IntPtr DC, int nXExtent, int nYExtent, ref GdiSize size);
Exemple #7
0
 private static extern bool ScaleViewportExtEx(IntPtr DC, int Xnum, int Xdenom, int Ynum, int Ydenom, ref GdiSize size);
Exemple #8
0
 public static extern int GetThemePartSize(int htheme, IntPtr hdc, int partID, int stateID, int rect, int sizeType, out GdiSize size);
Exemple #9
0
 private static extern bool GetTextExtentPoint32(IntPtr DC, string S, int Count, ref GdiSize Size);
Exemple #10
0
 public static extern bool GetTextExtentPoint32(IntPtr hdc, string s, int count, ref GdiSize size);
Exemple #11
0
 private static extern bool GetTextExtentExPoint(IntPtr hdc, string s, int len, int maxExtent, IntPtr lpnFit, IntPtr alpDx, ref GdiSize size);