Flood Fill algorithm (using C#.Net)

I had planned to do this tutorial/post a while ago but I kept putting it aside and did not have the time to really look into it and share this. Fortunately, today I finally got around to it, so here is flood fill. Flood fill is a method used in programs such as Microsoft Paint…

Collision detection in C#.Net & Java example

Suppose we are making a game that deals with collision of objects moving around the screen, like a simple pong game or maybe a physics simulation. Implementing collision detection in C# is very simple to do. In this example we have a ball and a racket sprites that are moving on the screen. If the…

Drawing a shape and moving it by mouse (using C#.Net)

Suppose we have an image or a shape drawn on a Picturebox control on a Windows Form. And we wanted to move the shape or image by mouse. The code is very quick to implement using C#.Net. ¬†Create a new Windows Form project Insert a picturebox onto the form Add Paint, MouseDown, MouseMove, and MouseUp…

Drawing by mouse on a PictureBox (Freehand drawing)

Brief overview of GDI+: Graphics Device Interface + (GDI+) is a graphical subsystem of Windows that consists of an application programming interface (API) to display graphics and formatted text on both video display and printer. GDI+ acts as an intermediate layer between applications and device drivers for rendering two-dimensional graphics, images and text. Suppose we…