Page 1 of 1

Can not use gflsavebitmap to save image

Posted: Wed Feb 23, 2005 6:58 am
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);

Re: Can not use gflsavebitmap to save image

Posted: Wed Feb 23, 2005 1:32 pm
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.