Go to the Project Explorer and expand the References section of your
project.  Is System.Drawing in there?  (It will be for a Windows Forms app,
but not most other kinds of apps.)  If not, right click on References,
select Add Reference..., and go and add System.Drawing.

If you read the compiler error you're getting, it probably says "are you
missing an assembly reference?".  This is a clue that you are missing an
assembly reference.  The solution is to go and add the relevant assembly
reference.  ;-)

Using Import (or C# using) statements doesn't tell the compiler to go and
look in any particular assembly.  It just tells it you want the contents of
a particular namespace to be in scope.  It knows which assemblies to look in
from the list specified in the References section of your project.  It can't
infer from the Import which assemblies you actually need because there isn't
a direct mapping between the names - for example, although you're trying to
import System.Drawing.Imaging, the assembly that the classes live in is
actually System.Drawing.  And some of the mappings are more whacky - a lot
of the System classes live in mscorlib, not System...


--
Ian Griffiths
DevelopMentor


----- Original Message -----
From: "Clinton Hess" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 10, 2002 3:00 PM
Subject: [DOTNET] Import?


I am trying to implement some bitmap functionality within a class.  I
seemingly cannot import System.Drawing.Imaging from within a class
project.  I can import this namespace when I am within a Windows
Application project, but a class and console project seemingly don't know
about this namespace.  I am assuming this has to do with the fact that a
Windows Application has a GUI, and a class and console project do not.  Is
there something I need to do so I can see this namespace within my class
project?  I just need a bitmap object to determine height, width, and bits
per pixel of different image files.  I don't plan to display the image in
anyway.  Can someone please point me in the correct direction?

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to