1

Hi I am trying to divide the logic of my simple WPF program to projects in .NET. I created project with type Class Library. After i tried to use class Bitmap in class of project but validator find error
"The type or namespace name 'Bitmap' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Микола\documents\visual studio 2013\Projects\dragNDrop\BusinessLogic\Util.cs" How to solve this trouble?

P.S. Sorry i'm only started to studing .NET, and their types of Projects

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace BusinessLogic
{
    class Util
    {
        public Bitmap cropImage(Bitmap img, Rectangle cropArea)
        {
            Bitmap bmpImage = new Bitmap(img);
            return bmpImage.Clone(cropArea, bmpImage.PixelFormat);
        }
    }
}
2
  • You need using System.Drawing; Commented Nov 7, 2014 at 21:09
  • i use using System.Drawing; Commented Nov 7, 2014 at 21:10

1 Answer 1

1

Open the Solution Explorer. In your project folder, right-click 'References'. Click 'Add reference'. In the list, check System.Drawing. Now the assembly reference is added to your project. Combined to the using line that you already have, the compiler should not complain anymore.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.