C# Graphics - Drawing Image on String Tutorial.

Here we want to see how to you draw a string on an image. We will make use of the Graphics class to do this. But first we will load our image from the file system via the Image class. That class provides with the FromFile() method which allows us easily load our image onto memory from the filesystem.

Then we draw that image using the Graphics class. We also draw a frame around the image and fill the rectangle with some color.

ThreadStart and ParemeterizedThreadStart


A ThreadStart is a delegate defined in the System.Threading namespace that represents the method that executes on a Thread.

Threads are lines of executions within a process and allow us write concurrent programs.

To be able to do this...

Introduction to Threads in C#

Towards the end of the 20th century, computers could already work with several programs simultaneously. This is normally called multitasking.

However, only one computing unit had to be executed at a given time. So the risk was that one program could monoplize the...

Years back, threads were implemented so isolate programs. In the early days, for example of Windows Version 3, Cooperative Multitasking was used.

With this technique, the Operating System executed all programs on a single execution loop.

The risk was that if one program encountered an error su...

C# Threading - Race Condition

Implementing Threads in applications is not an ardous task.

Tasks can divided implemented in independent threads and the threads can be scaled along with the number of CPU cores.

The problem comes when those threads need to interact with each other. And this is...



  • Stands for Common Intermediate Language.
  • Sits above .NET language.
  • Compilation of a typical C# class results into a .exe assembly file containing:

    • Manifest.
    • CIL instructions
    • Metadata describing the type.
  • .NET aware languages do emit CIL code and not platform specific instructio...

Introduction to Classes

Support for classes and objects(created from those classes) is the core construct of any C# program.

And indeed is what makes C# an object-oriented programming language.

Classes are templates for Object creation. Classes allow us create larger more organized programs th...

A class is a data structure that allows you to store data and execute code.

C# provides class as a construct that allows us create our own custom types.

A class contains data members and function members.

  1. Data Members - Store data associated with the class of an instance of the class. They...

C# Windows Forms : Labels

C# provides us with the Label class that represents a standard Windows Label.

This class obviously belongs to System.Windows.Forms. ```c# namespace System.Windows.Forms

This namespace itself is defined in the `System.Windows.Forms.dll`.
Assembly System.Wind...