Here're load and save procedure's parts.
Code: Select all
GFL_BITMAP *bitmap = gflAllockBitmap(GFL_BINARY, 200, 120, 1, NULL); //!!!!!
if ( bitmap == NULL )
return NULL;
GFL_FILE_INFORMATION info;
GFL_LOAD_PARAMS params;
memset(¶ms, 0, sizeof(GFL_LOAD_PARAMS));
gflGetDefaultLoadParams(¶ms);
params.Flags = GFL_LOAD_BINARY_AS_GREY;
params.FormatIndex = -1;
params.Origin = GFL_TOP_LEFT;
params.ColorModel = GFL_RGB;
params.LinePadding = 1;
params.DefaultAlpha = 0x00;
params.Width = 200;
params.Height = 120;
if ( gflLoadBitmap(fName, &bitmap, ¶ms, &info) != GFL_NO_ERROR )
return NULL;
........................................
Code: Select all
bool _fastcall saveImage(char *fName, const GFL_BITMAP &bitmap)
{
GFL_SAVE_PARAMS saveParams;
memset(&saveParams, 0, sizeof(GFL_SAVE_PARAMS));
saveParams.Flags = GFL_SAVE_ANYWAY;
saveParams.Compression = GFL_NO_COMPRESSION;
saveParams.Quality = 0;
saveParams.Progressive = true;
if ( gflSaveBitmap(fName, &bitmap, &saveParams) != GFL_NO_ERROR )
return false;
return true;
}
// Sorry for my bad English =(