gflLoadBitmap and .NET

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

Ciccio

gflLoadBitmap and .NET

Post by Ciccio »

I have a problem with "gflLoadBitmap" and .NET, everything seems to work fine when I use "gflGetFileInformation" I get all the info about the chosen file, I don't get any problem even when I use the "gflLoadBitmap" function, but strange enough my GFL_BITMAP continue to be an <undefined value> . Below is my code.

Any suggestion is greatly appreciated.

Ciccio


Bitmap* MyImage ;
GFL_FILE_INFORMATION *info=NULL;
GFL_BITMAP *TheBitmap=NULL;
info = new GFL_FILE_INFORMATION();
TheBitmap = new GFL_BITMAP();
GFL_LOAD_PARAMS load_params;
char* filename = (char*)(void*)Marshal::StringToHGlobalAnsi(openFileDialog1->FileName);
gflGetFileInformation( filename,-1,info);
gflGetDefaultLoadParams( &load_params );

if ( gflLoadBitmap( filename, &TheBitmap, &load_params, info ) )
MessageBox::Show( "Error loading file...", "Error" );
else
{
MessageBox::Show( "File Loaded...", "Status" );
User avatar
Ithier
Posts: 47
Joined: Fri Nov 19, 2004 10:50 am
Location: Paris, France

Post by Ithier »

Hi,

I don't know anything about .NET, but from a C++ point of view the line TheBitmap = new GFL_BITMAP(); is useless as all the GFL_BITMAP are managed by GflSdk. Allocation is done by functions like gflLoadBitmap or gflAllockBitmap and you have to use gflFreeBitmap when you do not need your GFL_BITMAP anymore.
GFL_BITMAP is <undefined value> (does it means NULL ?) means that something goes wrong during the gflLoadBitmap function. What is the return value of this function ?
Ciccio

Post by Ciccio »

>> GFL_BITMAP is <undefined value> (does it means NULL ?)
Yes I meant that all the members of GFL_BITMAP are undefined

>> means that something goes wrong during the gflLoadBitmap function. What is the return value of this function ?

Well actually the function return GFL_NO_ERROR, and I don't get any exception, that's the weird thing.