寻求C#代码以简单地绘制图像 [英] Seeking C# code to simply sketch image

查看:78
本文介绍了寻求C#代码以简单地绘制图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要C#代码来简单地绘制图像,如果有任何帮助,请..
我想将原始图像转换为其素描

I need C# code to simply sketch image, please if any one help..
I want to convert original image to its Sketch

for (int i = 0; i < 300; i++)
{
    for (int j = 0; j < 200; j++)
    {
        p = new Pen(bitmap.GetPixel(i, j), 1);//get pixel from the image/bitmap
        for (int r1 = 0; r1 < 100; r1++)
        {
              for (int r2 =0; r2 < 100; r2++)
              {
                  for (int r3 = 0; r3 < 100; r3++)
                  {
                      if (p.Color ! = Color.FromArgb(255, r1, r2, r3)) //check dark pixel
                      {
                          p.Color = Color.Transparent;
                      }
                      g.DrawRectangle(p, 1 * i, 1 * j, 1, 1);
                  }
              }
         }
    }
}



我得到了代码,但是很难作为类应用..并且无法理解什么是"p"以及如何使用要提供的位图图像将其作为类进行修改?
请帮忙!



I got the code but it is hard to apply as class.. and cannot understand what is "p" here and how to modify it as class with Bitmap image to be supplied??
Please help!

推荐答案

请参阅以下讨论和问题解答:
http://www.overroot.com/blog/?p=467 [ http://stackoverflow.com/questions/5675151/i-want-to-convert-an-image-into-pencil-sketch-in-opencv [ http://www.codeguru.com/forum/archive/index.php/t- 427328.html [ ^ ].

—SA
Please see these discussions and question answers:
http://www.overroot.com/blog/?p=467[^],
http://stackoverflow.com/questions/5675151/i-want-to-convert-an-image-into-pencil-sketch-in-opencv[^],
http://www.codeguru.com/forum/archive/index.php/t-427328.html[^].

—SA


阅读此-> http://www.cs.brown.edu/~tsm/AlgoSketch-sbim08-final. pdf [ ^ ]:)
Read This -> http://www.cs.brown.edu/~tsm/AlgoSketch-sbim08-final.pdf[^] :)


这篇关于寻求C#代码以简单地绘制图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆