zoukankan      html  css  js  c++  java
  • 动态获取Resources里面的图片列表

    假设Resources里面资源文件都是图片:

    //从资源文件查找,并释放到目录下
    Resources res = new Resources();
    foreach (PropertyInfo item in res.GetType().GetProperties(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance))
    {
      if (item.Name != "Culture" && item.Name != "ResourceManager")
      {
        if (item.GetValue(res, null) is Bitmap)
        {
          Bitmap b = item.GetValue(res, null) as Bitmap;
          if (!Directory.Exists(Path.Combine(Application.StartupPath, this.ImagePath)))
            Directory.CreateDirectory(Path.Combine(Application.StartupPath, this.ImagePath));
          b.Save(Path.Combine(Application.StartupPath, this.ImagePath + item.Name + ".gif"), System.Drawing.Imaging.ImageFormat.Gif);
        }
      }
    }
    View Code
  • 相关阅读:
    使用ansible 批量分发ssh密钥
    修改DNS
    如何使用openssl生成RSA公钥和私钥对
    压力测试 php-fpm 优化
    mysql 安装
    svn 权限配置
    powerdesigner导出word
    Mysql无法创建外键的原因
    office project 激活
    MySQL日志恢复误删记录
  • 原文地址:https://www.cnblogs.com/guyun/p/3047205.html
Copyright © 2011-2022 走看看