zoukankan      html  css  js  c++  java
  • 创建缩略图

     string file = files[i];
                    Image img 
    = Image.FromFile(file);
                    
    int width = img.Width;
                    
    int height = img.Height;
                    
    if (width > height)
                    {
                        width 
    = 800;
                        height 
    = width * img.Height / img.Width;
                    }
                    
    else
                    {
                        height 
    = 800;
                        width 
    = height * img.Width / img.Height;
                    }
                    Bitmap bt 
    = new Bitmap(width, height);
                    Graphics g 
    = Graphics.FromImage(bt);
                    g.DrawImage(img, 
    00, width, height);
                    
    //g.Save(
                    
    //Image small = img.GetThumbnailImage(width, height, null, IntPtr.Zero);

                    bt.Save(
    string.Format("{0}m{1}.jpg", topath, i.ToString("0000")), ImageFormat.Jpeg);
  • 相关阅读:
    CMDB 理论
    分布式
    闲着无聊 一个python的,三级菜单。装逼版。
    献上一段,派遣网易云音乐,音频的代码。
    redis 安装
    selenium之 chromedriver与chrome版本映射表(更新至v2.46)
    简单的爬虫
    anaconda使用方法
    crm开发之用户重置密码
    模块和包,logging模块
  • 原文地址:https://www.cnblogs.com/gateluck/p/2105267.html
Copyright © 2011-2022 走看看