.NET Drawing

The System.Drawing namespace provides graphical capabilities. With the tools found there, you can manipulate or create visual effects with images and primitive shapes. We provide instructions for using some of these amazing capabilities.

These C# articles cover the System.Drawing namespace. They explore Image, Size, Point and Font.
As an introduction, this simple console program opens an image with the Image.FromFile method. It then prints the size of the image to the console. If the program doesn't compile, try adding the assembly reference System.Drawing in Visual Studio.
Program that uses System.Drawing namespace [C#]
using System;
using System.Drawing;
class Program
{
static void Main()
{
Image image = Image.FromFile("C:\\background1.png");
Console.WriteLine(image.Size);
}
}
Output
{Width=180, Height=110}
Colors are the end result of how the light receptors in our eyes interact with our computer monitors. Also, things in the outside world apparently have colors too. We describe the Color type in the System.Drawing namespace.
Color
Images are usually stored as bitmaps, which represent collections of colored pixels. They can also store translucency values. Examples of the Image type are given here.
Image Thumbnail Image
If you want to draw shapes on a two-dimensional surface, you will need sizes and points. These are made up of integers and floating-point numbers.
Size SizeF Point PointFThe Font type is also found in the System.Drawing namespace. We describe some interesting techniques of handling fonts in your programs, beginning with the Font type itself.
Font Font Exists Method
These tips will not make it possible to create elaborate graphics, but they emphasize some important things about the System.Drawing namespace in the .NET Framework. Complex three-dimensional rendering requires more advanced libraries to work with.