Can not use gflsavebitmap to save image

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

Moderators: XnTriq, xnview

Vick

Can not use gflsavebitmap to save image

Post by Vick »

I want to change the format of the file,but i cant save in other format.
it has a error type 10.

Code: Select all

                pGFLbitmap = NULL;
							gflGetDefaultLoadParams(&gflLoadPara);
							gflLoadPara.Origin = GFL_BOTTOM_LEFT;
							gflLoadPara.ColorModel = GFL_BGR;
							gflError = gflLoadBitmap(ofn.lpstrFile, &pGFLbitmap, &gflLoadPara, &gflBitmapInfo);
	
                char sPath[150];
							gflGetDefaultSaveParams(&gflSavePara);
							gflSavePara.FormatIndex=3;//jpeg 
							sprintf (sPath, "%s%s.%s\0", PARA_ROOT, PARA_EXT, IMAGE_EXT);
												gflError = gflSaveBitmap(sPath, pGFLbitmap, &gflSavePara);
User avatar
xnview
Author of XnView
Posts: 36798
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Can not use gflsavebitmap to save image

Post by xnview »

Vick wrote:I want to change the format of the file,but i cant save in other format.
it has a error type 10.

Code: Select all

                pGFLbitmap = NULL;
							gflGetDefaultLoadParams(&gflLoadPara);
							gflLoadPara.Origin = GFL_BOTTOM_LEFT;
							gflLoadPara.ColorModel = GFL_BGR;
							gflError = gflLoadBitmap(ofn.lpstrFile, &pGFLbitmap, &gflLoadPara, &gflBitmapInfo);
	
                char sPath[150];
							gflGetDefaultSaveParams(&gflSavePara);
							gflSavePara.FormatIndex=3;//jpeg 
							sprintf (sPath, "%s%s.%s\0", PARA_ROOT, PARA_EXT, IMAGE_EXT);
												gflError = gflSaveBitmap(sPath, pGFLbitmap, &gflSavePara);
Use gflGetFormatIndexByName to set the output format.
Pierre.