zoukankan      html  css  js  c++  java
  • 【C#】剪切出图片的一部分

    using System.Drawing;
    using System.Drawing.Imaging;

    class Program
    {
      static void Main(string[] args)
      {
        // 画像を読み込む
        string baseFilePath = @"C:itmapBase.gif";
        Bitmap bmpBase = new Bitmap(baseFilePath);

        // 画像を切り抜く
        Rectangle rect = new Rectangle(2090450100);
        Bitmap bmpNew = bmpBase.Clone(rect, bmpBase.PixelFormat);

        // 画像をGIF形式で保存
        string newFilePath = @"C: bitmapNew.gif";
        bmpNew.Save(newFilePath, ImageFormat.Gif);

        // 画像リソースを解放
        bmpBase.Dispose();
        bmpNew.Dispose();
      }
  • 相关阅读:
    内置方法(item系列、__str__方法、__del__方法)
    POJ3436
    CF551B
    HDU1588
    HDU3117
    CF834D
    CF832D
    CF832C
    POJ1930
    POJ3666
  • 原文地址:https://www.cnblogs.com/sekihin/p/5415560.html
Copyright © 2011-2022 走看看