locked
Bitmap^ image RRS feed

  • Question

  • I have new Bitmap, load from file :

    Bitmap^ image=gcnew Bitmap(path);



    I want send pointer on bitmap:

    void load(Bitmap^ image)

    {
    ....
    }

    but it finish with this error :

    error C2065: 'Bitmap' : undeclared identifier


    What is wrong?? Can help me somebody???

    Monday, December 15, 2008 7:07 PM

Answers

  • First, make sure your project has a reference to System.Drawing.dll. Second, use either a using directive or a using declaration to bring the Bitmap type into scope, or fully qualify the typename:

    // using directive 
    using namespace System::Drawing; 
     
    void load(Bitmap^ image) 
    { ... } 
     
    // using declaration 
    using System::Drawing::Bitmap; 
     
    void load(Bitmap^ image) 
    { ... } 
     
    // full qualification 
    void load (System::Drawing::Bitmap^ image) 
    { ... } 

    • Proposed as answer by ildjarn Sunday, December 21, 2008 8:21 AM
    • Marked as answer by Rong-Chun Zhang Monday, December 22, 2008 9:01 AM
    Monday, December 15, 2008 7:24 PM