简体   繁体   中英

error C2248: 'Gdiplus::Bitmap::Bitmap' : cannot access private member declared in class 'Gdiplus::Bitmap'

i am getting this error and i dont know why or understand the reason:

    vector<double> fourier_descriptor(Gdiplus::Bitmap myBitmap)
{


    vector<double> res;
    Contour c;
    vector<Pixel> frame;// = c.GetContour(p);

frame = c.GetContour(myBitmap);


    return res;

}

the error is in this line frame = c.GetContour(myBitmap);

I can't find a reference for the GetContour method, but that looks like you're trying to pass a Bitmap by value, which (if I remember my C++ correctly) will invoke the copy constructor -- and Bitmap doesn't have a public copy constructor.

If you own Contour, rewrite that function to take a Bitmap* or Bitmap& instead (ie pass a pointer or reference), thereby avoiding the copy constructor.

Try passing it via reference:

vector<double> fourier_descriptor(Gdiplus::Bitmap& myBitmap)

Ny passing it by value, you make a copy of it, and Bitmap doesn't permit that.

Gdiplus::Bitmap in non-copyable. And you are trying to copy it when you attempt to pass it around by value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM