Code: Select all
GFL_BITMAP* Dst=NULL;
//Src - pointer to existing bitmap
gflResize(Src, &Dst, SaveW, SaveH, .., ..);
Moderators: XnTriq, helmut, xnview
Code: Select all
GFL_BITMAP* Dst=NULL;
//Src - pointer to existing bitmap
gflResize(Src, &Dst, SaveW, SaveH, .., ..);
Code: Select all
gflResize(Src, NULL, SaveWSync, SaveHSync, GFL_RESIZE_BILINEAR, 0);
??? Your Src is a good bitmap?Zai++ wrote:Access violation in module LIBGFL290.DLLCode: Select all
gflResize(Src, NULL, SaveWSync, SaveHSync, GFL_RESIZE_BILINEAR, 0);
Code: Select all
gflLibraryInit();
AnsiString lFileIn = "TestResize.tif";
GFL_LOAD_PARAMS lLoadOption;
GFL_FILE_INFORMATION lDestImageInfo;
GFL_BITMAP* lSrcBitmap;
GFL_BITMAP* lDestBitmap;
gflGetDefaultLoadParams(&lLoadOption);
GFL_ERROR lError = gflLoadBitmap(lFileIn.c_str(), &lSrcBitmap, &lLoadOption, &lDestImageInfo);
if (lError != GFL_NO_ERROR)
ExitProcess(lError);
lDestBitmap = NULL;
lError = gflResize(lSrcBitmap, &lDestBitmap, lSrcBitmap->Width / 2, lSrcBitmap->Height / 2, GFL_RESIZE_BILINEAR, 0);
if (lError != GFL_NO_ERROR)
ExitProcess(lError);
gflFreeFileInformation(&lDestImageInfo);
gflFreeBitmap(lSrcBitmap);
gflFreeBitmap(lDestBitmap);
gflLibraryExit();
Code: Select all
G.Data=reinterpret_cast<GFL_UINT8>(const_cast<void>(Saveable->GetDataAddress()));
G.LinePadding=Saveable->AlignRow;
G.BytesPerLine=Saveable->VB;
switch(dpp)
{
case 32:
G.Type= GFL_BGRA;
G.ComponentsPerPixel=G.BytesPerPixel=4;
break;
case 24:
G.Type= GFL_BGR;
G.ComponentsPerPixel=G.BytesPerPixel=3;
break;
case 8:
G.Type= GFL_GREY;
G.ComponentsPerPixel=G.BytesPerPixel=1;
break;
...and so on
Code: Select all
G.LinePadding=G.BytesPerLine;
instead of
G.LinePadding=4;//real padding
Code: Select all
GFL_BITMAP::LinePadding Internal use, do not modify.
I'm not shure but you have special functions to translate this kind of Bitmap. From the doc :But I use GFL_BITMAP with alien data, that is GFL_BITMAP::Data points to a memory of WinAPI DIBSection
andgflConvertBitmapIntoDIB
The gflConvertBitmapIntoDIB function converts a GFL_BITMAP in a Windows Device Independant Bitmap
If the help says not to change a value I think it's better to do not. LinePadding should be calculated internally while building a specific bitmap with a given type and count of pixel. I imagine it's to have a specific BytesPerLine to faster pixel access or algorithm calculation.gflConvertDIBIntoBitmap
The gflConvertDIBIntoBitmap function converts a Windows Device Independant Bitmap into GFL_BITMAP.