Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reference system.drawing in Visual Studio 2010 Express?

I'm somewhat new to this and I am under the impression that to draw a rectangle that I've created, I need to use system.drawing.graphics. Thing is, I get the error

"The type or namespace name 'drawing' does not exist in the namespace 'System' (are you missing an assembly reference?)"

and when I right click the References folder in the solution explorer, system.drawing is nowhere to be found. So I'm not exactly sure how to move forward in drawing a rectangle.

like image 531
Jaghancement Avatar asked Feb 26 '12 03:02

Jaghancement


People also ask

How do you add references to System drawing DLL?

Kartiikeya, in the Solution Explorer tab, right click on References and select "Add Reference...". Then click Assemblies, Framework, and scroll down until you see System. Drawing. Click the checkbox next to it, then click OK.

What is using System drawing in C#?

The Graphics class provides methods for drawing to the display device. Classes such as Rectangle and Point encapsulate GDI+ primitives. The Pen class is used to draw lines and curves, while classes derived from the abstract class Brush are used to fill the interiors of shapes.

Where is System drawing common?

Breaking change: System. Drawing. Common only supported on Windows - . NET | Microsoft Learn.

What is a System drawing?

Mechanical systems drawing is a type of technical drawing that shows information about heating, ventilating, air conditioning and transportation around the building (Elevators or Lifts and Escalator). It is a powerful tool that helps analyze complex systems.


1 Answers

Namespace should be available to you no matter the version of VS2010. Right click "References", "Add Reference...", ".NET" tab, sort by component name and select "System.Drawing" and "OK".

If it doesn't show then you might want to look into your build properties on your project and see what framework you're targeting (2.0, 3.5, 4.0, etc...)

like image 186
Brian Minnich Avatar answered Sep 28 '22 00:09

Brian Minnich