在C#中为区域着色 [英] Coloring the region in C#

查看:123
本文介绍了在C#中为区域着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在尝试像MS Paint一样开发应用程序,我想用我正在绘制的形状填充颜色,假设我有一个矩形,并且我想用颜色填充它,因此我无法通过将形状添加到填充颜色的区域来做到这一点到该区域,但是问题是,如果我在表单上具有三个形状,那么只需单击一下表单中的任何位置,就可以将这三个形状全部填充起来,我想分别填充它们.任何人都可以在这方面提供帮助.
Manish Kumar Sharma

解决方案

好-鉴于您之前曾问过一次,而我将您链接到了一篇完全符合您要求的文章,为什么有人会费心尝试帮助您您是否忽略答复,然后再次问相同的问题?


有问题的文章正在解释如何进行洪水填充,这意味着它将仅填充一种形状.如果填充得更多,则形状不会闭合.在这种情况下,没有洪水填充方法将起作用.您既要在要回复时又要在添加到问题中时都应编辑问题.如果这个问题和上一个问题之间有根本性的区别,那么它就被很好地隐藏了,并且您当然没有在问题中声明您以前曾尝试过任何东西,但我认为没有任何建议可言.

除了做问题外,还做了其他任何事情.嗯,您似乎真的很生气,但让我告诉您,我也没有忽略您的答案,并且我也阅读了该链接,那时候问题不一样,我现在不能给形状上色了,但是屏幕上的所有形状都立刻变色了,而不是分别给它们上色,可能是我无法清楚地说明它,但先生,所以没有得到生气对健康有害,要开心


Hi everyone,
I m trying to develop application just like MS Paint i want to fill the color in the shapes i am drawing suppose i have a rectangle and i want to fill it with color i m able to do that by adding the shapes to region anf filling the color to the region but the problem is this if i have three shapes on the form all three a getting filled just by a single click anywhere on the form i want them to be filled seperately can anyone help in this.
Manish Kumar Sharma

解决方案

OK - given that you asked this once before and I linked you to an article that does exactly what you want, why would anyone bother trying to help you if you ignore replies and then just ask the same question again ?


The article in question was explaining how to do flood fill, which means it will fill only one shape. If it''s filling more,then your shapes are not closed. No flood fill method will work in this instance. You should edit your question, both when you want to reply, and when you want to add to your question. If there''s a fundamental difference between this question and the last one, it''s well hidden, and you certainly don''t state in your question that you''ve tried anything previously, I see nothing to suggest you''d done anything apart from rewording the question.


well you seems to be really angry but let me tell you that i have not ignored your answer and i read that link too,and that time the question was not same,i was not able to color the shapes that time now i can but all the shapes on screens are getting colored at once instead of coloring them seperately may be i m not able to state it clearly but sir so do not get so angry it is not good for health,be happy


这篇关于在C#中为区域着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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