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
  • 相关阅读:
    Quartz 基本概念及原理
    quartz-2.2.x 快速入门 (1)
    hive踩过的小坑
    spring profile 多环境配置管理
    win10窗口设置眼睛保护色
    优雅地在markdown插入图片
    Using Spring Boot without the parent POM
    isDebugEnabled作用
    Log 日志级别
    为什么要使用SLF4J而不是Log4J
  • 原文地址:https://www.cnblogs.com/guyun/p/3047205.html
Copyright © 2011-2022 走看看