This function displays the "Save" dialog which includes a file preview and file information. This dialog is used to select an image file to be saved.

[C++Builder]   BOOL IKSaveFileDialog(HWND hWnd, LPSTR FileName, LPCTSTR FilePath, LPCTSTR FileExt, BOOL ExtendedDialog, BOOL Preview, LPINT FileType, BOOL FileInfo);
[Delphi]   function IKSaveFileDialog(hWnd: HWND; FileName, FilePath, FileExt: PChar; ExtendedDialog, Preview: LongBool; var FileType: Integer; FileInfo: LongBool): LongBool;

Parameters

Name Explanation
hWnd The window handle
FileName The name of the selected file or the name of the file initially displayed in the "Save" dialog
FilePath The name of the directory shown in the "Save" dialog when it is first displayed. If this parameter is blank then the current directory is shown.
FileExt This sets the types of files that are shown in the "Save" dialog when it is first displayed. To set multiple file types use a semicolon as a delimiter. Ex: "BMP;JPG". Setting an asteriks "*" will remove the term "All Files" from the dropdown menu in the "Save" dialog. If you surround the file type with "<>" as in "<JPG>" then that file type will be displayed as the default type.
ExtendedDialog False(0): Preview and FileInfo checkbox is not displayed
True(nonzero): Preview and FileInfo checkbox is displayed
Preview Sets the file preview function when the "Save" dialog is first displayed. False (0): No preview, True (nonzero): Preview
FileType The type of file that has been selected.
1:BMP, 2:JPEG, 3:GIF, 4:TIFF, 5:PNG, 6:FPX, 7:PCX, 8:WMF, 9:EMF, 10:DXF, 11:SVG, 12:JPEG2000, 13:JPEG2000(Code Stream), 14:SXF(p21), 15:SXF(sfc)
FileInfo Sets whether or not the file information displayed when the "Save" dialog is first displayed. False(0): File information not displayed, True (nonzero): File information is displayed

Return Value

Returns True (nonzero) if "Save" is selected. Returns False (0) if "Cancel"is selected.

Explanation

The IKSaveFileDialog function displays the "Save" dialog which includes a file preview and file information. This dialog is used to select an image file to be saved.

The FilePath and FileExt parameters set the file that is shown in the list when the "Save" dialog is initially displayed. If the FileName parameter contains the full path, then the FilePath parameter is disabled. By selecting the Save button, the file name and full path are set in the FileName parameter. When the Save button is clicked, FileType parameter returns the type of file that was selected in the "Save" dialog. If ExtendedDialog is set to true, when the dialog is displayed the preview and file information checkboxes are displayed. Even if Preview and FileInfo are False, these checkboxes will be displayed.

 To reference a vector image in the preview , you must first execute the Ik10VectCom.dll, Ik10VectComA.dll, Ik10VectCom64.dll, or Ik10VectCom64A.dll's IKVectorGdipStart function.

Example:

In C++Builder

   TCHAR FileName[256];
   BOOL Ret;
   int FileType;

   memset(FileName, 0, sizeof(FileName));   //in this case, the FilePath parameter is enabled
   //if the file name and full path are set into the FileName parameter, then the FilePath parameter is disabled
   //lstrcpy(FileName, "C:\\Images\\001.jpg");

   Ret = IKSaveFileDialog(Form1->Handle, FileName, "C:\\My Pictures", "*;BMP;JPG;", FALSE, &FileType);

In Delphi

   FileName: array [0..255] of Char;
   Ret: LongBool;
   FileType: Integer;
   FillChar(FileName, SizeOf(FileName), 0);   // in this case, the FilePath parameter is enabled
   //if the file name and full path are set into the FileName parameter, then the FilePath parameter is disabled
   //StrPCopy(FileName, 'C:\Images\001.jpg');
   Ret = IKSaveFileDialog(Form1.Handle, FileName, 'C:\My Pictures', '*;BMP;JPG;', False, FileType);

 

The ImageKit10 VCL is a product created by Newtone Corporation