What do I need to include to make a Bitmap?

I'm using VC++2005 and I'm trying to make and save a bitmap for debugging. The statement:

Bitmap myBitmap:

gives error C2065 'Bitmap' : Undeclared identifier

What do I have to include to identify Bitmap as a class

After I get that done, what will I have to do to get Format32bbpArgb recognized

Thanks,

Ken



Answer this question

What do I need to include to make a Bitmap?

  • 超初心者

    It sounds like you didn't create a CLR project. Best thing to do: create a new project using one of the C++/CLR templates and duplicate the project settings into your project. Are you sure you want a CLR project You'll have to write the bitmap declaration like this:
    Bitmap^ myBitmap;
    and use the gcnew operator to create it. If none of this makes sense, you probably don't want to use the Bitmap class.



  • AaronG85

    Your right. I don't have a CLR project, at least I don't think I do, and it doesn't make sense so I will abandon this approach to debugging my real problem.

    Thanks, for the advice. I think you probably saved me at least a day of beating my head against the wall.

    Ken


  • msbhvn

    Try adding "using namespace System::Drawing;" after your include files. Prefix Format32bppArgb with PixelFormat::



  • Pink Triangles

    Now it complains about that statment with

    error C2653: 'System' : is not a class or namespace name

    also

    error C2871: 'Drawing' : a namespace with this name does not exist

    Am I still missing an include

    Ken


  • What do I need to include to make a Bitmap?