Okay, I've tried to wrap the Bitmap class myself and try to extend the wrapper into supporting the Rasterize function. The problem is, I'm new to this wrapping stuff so I'm having some trouble in the process.
This is the MBitmap class I've added to the exsitent wrapper by Brad:
Code: Select all
public ref class MBitmap{
public:
/* Wrapping constructors */
MBitmap( int pixelWidth, int pixelHeight, int byteSpan, mColorDepth mcd, const unsigned char *bits){
CameraLibrary::Bitmap::ColorDepth cd = static_cast<CameraLibrary::Bitmap::ColorDepth>(mcd);
bitmap = new Bitmap(pixelWidth, pixelHeight, byteSpan, cd, bits );
}
MBitmap( int pixelWidth, int pixelHeight, int byteSpan, mColorDepth mcd){
MBitmap(pixelWidth, pixelHeight, byteSpan, mcd, 0);
}
~MBitmap(){
delete this->bitmap;
bitmap = 0;
}
//Wrapping functions
int PixelWidth() {return bitmap->PixelWidth();}
int PixelHeight() {return bitmap->PixelHeight();}
int ByteSpan() {return bitmap->ByteSpan();}
int GetPixel(int X, int Y) {return bitmap->GetPixel(X,Y);}
// GUI uses this to draw.
const unsigned char *GetBits() {return bitmap->GetBits();}
int BufferSize() {return bitmap->BufferSize();}
public:
//private:
Bitmap * bitmap;
};
And this is the rasterize function on the MFrame managed class:
Code: Select all
///== Rasterization Functionality ==========--
void Rasterize(MBitmap bitmapRef){frame->Rasterize(bitmapRef.bitmap);}
The problem is, when calling this Rasterize function from my application, I get a criptic error saying "Rasterize is not supported by the language".
Any ideas on what I'm doing wrong?