zoukankan      html  css  js  c++  java
  • [Winform][C#]获取系统颜色预定义颜色和现有字体集

    转自: http://zhidao.baidu.com/link?url=ozY7tJRNBYHUsImE6jn1psqc8owib7MWcDMEmZw48q8iD9Hz9MWgnQQcBDO0VYOFXGv4hi8RVmOidouvpmZL-K
    public static void GetFontAndColor()
    {
        //使用如下命令就可以得到当前系统所有字体
        InstalledFontCollection MyFont = new InstalledFontCollection();
        List<FontFamily> listf = new List<FontFamily>();
        FontFamily[] MyFontFamilies = MyFont.Families;
        //InstalledFontCollection 对象只看得见在创建它之前安装在 Windows 中的字体。如果用c#创建安装字体程序要使用GDIAddFontResource 函数
        InstalledFontCollection fc = new InstalledFontCollection();
        foreach (FontFamily font in fc.Families)
        {
            listf.Add(font);
        }
        //获取系统颜色预定义颜色
        Array colors = System.Enum.GetValues(typeof(KnownColor));
        List<KnownColor> listc = new List<KnownColor>();
        foreach (KnownColor colorName in colors)
        {
            listc.Add(colorName);
        }
    }

     //不要使用 InstalledFontCollection 类在 Windows 中安装字体。而应使用 GDIAddFontResource 函数。InstalledFontCollection 对象只看得见在创建它之前安装在 Windows 中的字体。

  • 相关阅读:
    Hadoop使用实例
    hdfs操作命令
    Hadoop安装与HDFS体系结构
    Linux和MySQL的安装与基本操作
    Hadoop演进与Hadoop生态
    作业一
    Shader笔记——9.简单灰色效果+遮罩
    iOS——xcodeproj脚本
    iOS——KSAdSDK
    UnityPlugins——4.SignInWithApple
  • 原文地址:https://www.cnblogs.com/z5337/p/5144143.html
Copyright © 2011-2022 走看看