Add a reference to System.Drawing
When you use using
statements, this lets the compiler know that when you say Image
you really mean System.Drawing.Image
for example.
However, now the compiler needs to know where System.Drawing is. By default, in Visual Studio, you will probably already reference System
, System.Data
, and System.Xml
.
Now you are writing for System.Drawing
. Right-click the project in the project browser, and select "Add reference...". This will present you with a tabbed interface that lets you select one of:
- A .NET Reference. Any assembly in the GAC will be listed here. Scroll down and select
System.Drawing
for example.
- COM Reference. For interfacing with non-.NET, yet very Windows components.
- Projects. A Visual Studio nicety. Reference a DLL that has not been built yet. Select a project within the same solution. Intellisense before you compile.
- Browse (for a file). If a .NET component or other type with exported definitions has already been built, you can reference the DLL from here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…