コード例 #1
0
        public IntPtr ToHfont()
        {
            if (fontObject == IntPtr.Zero)
            {
                throw new ArgumentException(Locale.GetText("Object has been disposed."));
            }

            if (GDIPlus.RunningOnUnix())
            {
                return(fontObject);
            }

            // win32 specific code
            if (olf == null)
            {
                olf = new LOGFONT();
                ToLogFont(olf);
            }
            LOGFONT lf = (LOGFONT)olf;

            return(GDIPlus.CreateFontIndirect(ref lf));
        }