Displays the Open Picture dialog box and returns the name of the picture file you chose.
Note: |
---|
You can preview images in Windows 2000 and later by clicking the View Menu icon and then Thumbnails. Visual FoxPro uses the Thumbnails view as the default setting to provide mini-previews of images. Therefore, the Open Picture dialog box no longer includes a frame for displaying an image. The Preview check box appears in the Open Picture dialog box only when running Visual FoxPro on operating systems earlier than Windows 2000. |
GETPICT([cFileExtensions] [, cFileNameCaption] [, cOpenButtonCaption]) |
Parameters
- cFileExtensions
-
Specifies the file extensions of the picture files displayed in the scrollable list when the All Files menu item isn't chosen.
cFileExtensions can take the following forms:
-
If cFileExtensions contains a single extension (for example, .bmp), only files with that extension are displayed.
-
cFileExtensions can also contain wildcards (* and ?). All files with extensions that meet the wildcard criteria are displayed. For example, if cFileExtensions is ?X?, all files with the extension .fxp, .exe, and .txt are displayed.
-
If cFileExtensions contains an empty string (""), all available graphics files (for example, files with the extensions .bmp and .dib ) are displayed.
-
If cFileExtensions contains a single extension (for example, .bmp), only files with that extension are displayed.
- CFileNameCaption
- Specifies the caption displayed to the left of the File Name text box. cFileNameCaption replaces "File Name" that appears when cFileNameCaption is omitted.
- cOpenButtonCaption
- Specifies a caption for the OK button.
Return Value
Character data type. Returns the name of the picture file you chose.
Remarks
The GETPICT(В ) function returns the empty string if you exit the Open Picture dialog box by pressing ESC, choosing the Cancel button, or clicking the Close button. The Open Picture dialog box displayed by typing GETPICT(В ) in the Command window makes it possible for you to quickly locate all the graphic files supported in Visual FoxPro. In versions earlier than Visual FoxPro 8.0, check the Preview check box in the Picture Open dialog box to display the currently selected graphics file.
The following table lists the graphic file formats that Visual FoxPro supports.
Graphic format | File extension |
---|---|
Animated Cursor |
.ani |
Bitmap |
.bmp |
Cursor |
.cur |
Device Independent Bitmap |
.dib |
Exchangeable Image File |
.exif |
Graphics Interchange Format |
.gif, .gfa |
Joint Photographic Electronic Group, JPEG File Interchange Format |
.jpg, .jpeg, .jpe, .jfif |
Icon |
.ico |
Portable Networks Graphics |
.png |
Tag Image File Format |
.tif, .tiff |
Windows Enhanced Metafile |
.emf |
Note: |
---|
In Visual FoxPro, cursor, animated cursor, and icon files can be used as graphics files. For example, you can specify an animated cursor file for the Picture property for the Image control (however, the Image control displays the static representation of the cursor). |
Use the CLEAR RESOURCES command to clear all cached graphic files, including .gif and .jpg files.