悬崖上的指纹

导航

 
            PrivateFontCollection p_Font = new PrivateFontCollection();
            byte[] b_Font = new byte[WindowsFormsApplication1.Properties.Resources.impact.Length];
            IntPtr MeAdd = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(byte)) * b_Font.Length);
            Marshal.Copy(WindowsFormsApplication1.Properties.Resources.impact, 0, MeAdd, WindowsFormsApplication1.Properties.Resources.impact.Length);
            p_Font.AddMemoryFont(MeAdd, b_Font.Length);
            labelX1.Font = new Font(p_Font.Families[0], 18, FontStyle.Bold | FontStyle.Regular);

  其中WindowsFormsApplication1表示程序集 

  labelX1表示的控件

posted on 2014-10-22 23:48  悬崖上的指纹  阅读(209)  评论(0)    收藏  举报