PDA

View Full Version : opening and saving images using intel jpg library



fox
03-21-2001, 09:19 AM
Hi
I'm using the intel jpeg library and the class wrapper - How do I get file to save and open from menu - what do you call in the file open and save handlers?

thanx

Tom Nuydens
03-21-2001, 09:46 AM
You can use the GetOpenFileName() and GetSaveFileName() functions to show dialog boxes from which you can pick a file. Both functions need an OPENFILENAME structure as a parameter. You can search for these terms on MSDN for more details.

- Tom

fox
03-22-2001, 12:25 AM
thanx a lot

fox
03-22-2001, 01:28 AM
I have the function below:
RenderToJpeg(LPTSTR szFile, int quality)

would I call it in OnFileOpen and OnFileSave?

my onFilesave looks like below

CString fname;

CFileDialog fdlg(FALSE, lpszDefExt, lpszDefName, dwFlags, lpszFilter, this);

if(IDOK == fdlg.DoModal())
{
fname = fdlg.GetPathName();
CCodaVisDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDoc->OnSaveDocument(fname);
}
return;