zoukankan      html  css  js  c++  java
  • C#中图片的重绘

    像大多数的图片转换工具一样,C#的重绘功能也可以实现相同的效果.

    Graphics g = this.CreateGraphics();
    g.Clear(Color.White);
    Bitmap image 
    = new Bitmap("test.jpg");
    int Width = image.Width - 1;
    int Height = image.Height - 1;

                
    //绘制原图   
    g.DrawImage(image, 00);
    g.TranslateTransform(image.Width, 
    0);

    /*image2、image3分别用来保存最大值法   
                和加权平均法处理的灰度图像
    */

    Bitmap image2 
    = image.Clone(new Rectangle(00, image.Width,image.Height),PixelFormat.DontCare);
    Bitmap image3 
    = image.Clone(new Rectangle(00, image.Width,image.Height),PixelFormat.DontCare);

    Color color;
    使用平均值进行灰度处理
    使用最大值法进行灰度处理
    使用加权平均法进行灰度处理
    灰度的还原演示,还原使用最大值法处理的灰度图像image2
                
    //重新绘制还原后的伪彩色位图   
                
    //重新绘制灰度化图  
                g.DrawImage(image2, new Rectangle(00, Width, Height));

  • 相关阅读:
    Codeforces Round #340 (Div. 2)
    搞清楚一下格式化输出
    TYVJ P1091 等差数列 Label:dp
    TYVJ P1098 任务安排 Label:倒推dp 不懂
    TYVJ P1034 尼克的任务 Label:倒推dp
    TYVJ P1045 &&洛谷 1388 最大的算式 Label:dp
    TYVJ P1046 Blast Label:dp
    TYVJ P1051 选课 Label:多叉转二叉&&树形dp(虐心♥)
    TYVJ P1073 加分二叉树 Label:区间dp
    二叉树遍历入门 Lebal:research
  • 原文地址:https://www.cnblogs.com/symbol441/p/1004502.html
Copyright © 2011-2022 走看看