Example #1
0
        Create(
            string strFace,
            int iSize,
            int degrees)
        {
            // Calculate font height based on this ratio:
            //
            //    Height in Pixels       Desired Point Size
            //  -------------------  =   ------------------
            //   Device Resolution              72
            //
            // (72 point = approx. 1 inch.)
            //
            // Which results in the following formula:
            //
            // Height = (Desired_Pt * Device_Res) / 72
            //
            IntPtr hdc   = GdiGraphics.GetDC(IntPtr.Zero);
            IntPtr hfont = Create(strFace, iSize, degrees, hdc);

            GdiGraphics.ReleaseDC(IntPtr.Zero, hdc);
            return(hfont);
        }