Click here to Skip to main content
15,905,325 members
Home / Discussions / C#
   

C#

 
QuestionMaking video call Pin
Darken19897-Apr-09 15:34
Darken19897-Apr-09 15:34 
AnswerRe: Making video call Pin
Christian Graus7-Apr-09 17:38
protectorChristian Graus7-Apr-09 17:38 
QuestionCrystal Reports Pin
CodingYoshi7-Apr-09 11:06
CodingYoshi7-Apr-09 11:06 
AnswerRe: Crystal Reports Pin
Mycroft Holmes7-Apr-09 12:28
professionalMycroft Holmes7-Apr-09 12:28 
QuestionIn search of a good PDF viewer control for .NET WinForms Pin
gongchengshi7-Apr-09 10:04
gongchengshi7-Apr-09 10:04 
AnswerRe: In search of a good PDF viewer control for .NET WinForms Pin
Christian Graus7-Apr-09 10:45
protectorChristian Graus7-Apr-09 10:45 
QuestionButton does not generate clicked events after validating textbox in a usercontrol Pin
hmvo247-Apr-09 9:44
hmvo247-Apr-09 9:44 
QuestionRTCP Packet in .net (c# or vb.net) Pin
Saurabh90907-Apr-09 9:11
Saurabh90907-Apr-09 9:11 
QuestionLaunching and Saving an Excel file from Winform Pin
DevWithDoutbs7-Apr-09 8:43
DevWithDoutbs7-Apr-09 8:43 
AnswerRe: Launching and Saving an Excel file from Winform Pin
Rolf Jaeger15-Jun-09 17:25
Rolf Jaeger15-Jun-09 17:25 
QuestionUsing StreamWriter...... Help Guys [modified] Pin
Rajdeep.NET is BACK7-Apr-09 8:32
Rajdeep.NET is BACK7-Apr-09 8:32 
AnswerRe: Using StreamWriter...... Help Guys Pin
behzadcp7-Apr-09 8:40
professionalbehzadcp7-Apr-09 8:40 
GeneralRe: Using StreamWriter...... Help Guys Pin
Rajdeep.NET is BACK7-Apr-09 8:44
Rajdeep.NET is BACK7-Apr-09 8:44 
AnswerRe: Using StreamWriter...... Help Guys Pin
Ashfield7-Apr-09 20:55
Ashfield7-Apr-09 20:55 
GeneralRe: Using StreamWriter...... Help Guys Pin
al3xutzu007-Apr-09 22:45
al3xutzu007-Apr-09 22:45 
Questionadd control to syncfusion gridcontrol Pin
behzadcp7-Apr-09 8:27
professionalbehzadcp7-Apr-09 8:27 
AnswerRe: add control to syncfusion gridcontrol Pin
Judah Gabriel Himango7-Apr-09 19:34
sponsorJudah Gabriel Himango7-Apr-09 19:34 
QuestionBusqueda en un Datagridview Pin
yaguis7-Apr-09 8:07
yaguis7-Apr-09 8:07 
AnswerRe: Busqueda en un Datagridview Pin
Christian Graus7-Apr-09 11:14
protectorChristian Graus7-Apr-09 11:14 
AnswerRe: Busqueda en un Datagridview Pin
Rajdeep.NET is BACK7-Apr-09 20:02
Rajdeep.NET is BACK7-Apr-09 20:02 
AnswerRe: Busqueda en un Datagridview Pin
Blue_Boy7-Apr-09 22:19
Blue_Boy7-Apr-09 22:19 
QuestionFlood Fill in C# Pin
k_crysa7-Apr-09 7:49
k_crysa7-Apr-09 7:49 
I have just started working in c# so I'm not that familiar with it. Still, I need to build a paint program and I am a bit stuck at Flood Fill. I want to be able to fill areas with an undetermined shape, so I used the SetPixel command, but it sets only one pixel (I'm not entirely sure of this).

For now, I try to change the color from white to one I pick myself. I call the function in the MouseDown function, and I think it should work.

Please help!


bmp = new Bitmap(pictureBox1.Width,pictureBox1.Height);

private void FloodFill(int x, int y)
{
bmp.SetPixel(x, y, DrawColor); //sets the color of the pixel to DrawColor I picked
pictureBox1.Image = bmp; // assigns the bitmap to the picture box; I work with it to be ale to save the picture
if (bmp.GetPixel(x + 1, y) == Color.White) //all four search for each white pixel
FloodFill(x + 1, y);
if (bmp.GetPixel(x, y + 1) == Color.White)
FloodFill(x, y + 1);
if (bmp.GetPixel(x - 1, y) == Color.White)
FloodFill(x - 1, y);
if (bmp.GetPixel(x, y - 1) == Color.White)
FloodFill(x, y - 1);
return;
}

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
startPoint.X = e.X;
startPoint.Y = e.Y;

FloodFill(e.X, e.Y);
pictureBox1.Image = bmp;

drag = true;
}
AnswerRe: Flood Fill in C# Pin
Thomas Stockwell7-Apr-09 9:22
professionalThomas Stockwell7-Apr-09 9:22 
AnswerRe: Flood Fill in C# Pin
Christian Graus7-Apr-09 11:15
protectorChristian Graus7-Apr-09 11:15 
AnswerRe: Flood Fill in C# Pin
dybs7-Apr-09 19:19
dybs7-Apr-09 19:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.