Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
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 
GeneralNeed Coding advice Pin
al3xutzu007-Apr-09 7:05
al3xutzu007-Apr-09 7:05 
GeneralRe: Need Coding advice Pin
Xmen Real 7-Apr-09 7:29
professional Xmen Real 7-Apr-09 7:29 
QuestionDatagridview comboboxcolumn question Pin
NewToAspDotNet7-Apr-09 7:04
NewToAspDotNet7-Apr-09 7:04 
AnswerRe: Datagridview comboboxcolumn question Pin
al3xutzu007-Apr-09 7:25
al3xutzu007-Apr-09 7:25 
GeneralRe: Datagridview comboboxcolumn question Pin
Xmen Real 7-Apr-09 7:32
professional Xmen Real 7-Apr-09 7:32 
QuestionHow do I disable external memory writing access to a Process? Pin
Fyrecrypts7-Apr-09 6:37
Fyrecrypts7-Apr-09 6:37 
AnswerRe: How do I disable external memory writing access to a Process? Pin
Xmen Real 7-Apr-09 6:49
professional Xmen Real 7-Apr-09 6:49 
AnswerRe: How do I disable external memory writing access to a Process? Pin
Dave Kreskowiak7-Apr-09 6:57
mveDave Kreskowiak7-Apr-09 6:57 
GeneralRe: How do I disable external memory writing access to a Process? Pin
Fyrecrypts7-Apr-09 6:59
Fyrecrypts7-Apr-09 6:59 
AnswerRe: How do I disable external memory writing access to a Process? Pin
Dan Neely7-Apr-09 8:23
Dan Neely7-Apr-09 8:23 
GeneralRe: How do I disable external memory writing access to a Process? Pin
Fyrecrypts7-Apr-09 8:41
Fyrecrypts7-Apr-09 8:41 
GeneralRe: How do I disable external memory writing access to a Process? Pin
Eddy Vluggen7-Apr-09 9:34
professionalEddy Vluggen7-Apr-09 9:34 
GeneralRe: How do I disable external memory writing access to a Process? Pin
Fyrecrypts7-Apr-09 9:38
Fyrecrypts7-Apr-09 9:38 
QuestionThreading - CPU/RAM Usuage Pin
dataminers7-Apr-09 6:14
dataminers7-Apr-09 6:14 

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.