C
cody
I have the following given:
size_t (*StreamHandler)(const Image *,const void *,const size_t);
Image *ReadStream(StreamHandler);
size_t ImageLdr::MyStreamHandler(const MagickLib::Image *image,const
void *pixels, const size_t columns)
{
}
Now I want to call ReadStream in my code:
MagickLib::Image* img = ReadStream(&ImageLdr::MyStreamHandler);
But the compiler tells me "can't take address of
'MagickNet::ImageLdr::MyStreamHandler' unless creating delegate instance".
And when I create a delegate:
public delegate size_t SH(const MagickLib::Image *image,const void
*pixels, const size_t columns);
SH^ sh = gcnew SH(this, &ImageLdr::MyStreamHandler);
MagickLib::Image* img = ReadStream(sh);
Then it says: "cannot convert parameter 2 from 'MagickNet::SH ^' to
'MagickLib::StreamHandler'".
So how can I pass my method to this function?
size_t (*StreamHandler)(const Image *,const void *,const size_t);
Image *ReadStream(StreamHandler);
size_t ImageLdr::MyStreamHandler(const MagickLib::Image *image,const
void *pixels, const size_t columns)
{
}
Now I want to call ReadStream in my code:
MagickLib::Image* img = ReadStream(&ImageLdr::MyStreamHandler);
But the compiler tells me "can't take address of
'MagickNet::ImageLdr::MyStreamHandler' unless creating delegate instance".
And when I create a delegate:
public delegate size_t SH(const MagickLib::Image *image,const void
*pixels, const size_t columns);
SH^ sh = gcnew SH(this, &ImageLdr::MyStreamHandler);
MagickLib::Image* img = ReadStream(sh);
Then it says: "cannot convert parameter 2 from 'MagickNet::SH ^' to
'MagickLib::StreamHandler'".
So how can I pass my method to this function?