[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Gets a filter string for files using the specified graphic class type.
Source position: graphics.pp line 1907
function GraphicFilter( |
GraphicClass: TGraphicClass |
):string; |
GraphicClass |
|
TGraphic class or descendant for the requested filter value. |
String with a filter value compatible with file dialogs.
GraphicFilter is a String function used to get a filter value for image files compatible with the graphics class type specified in GraphicClass. The return value contains a description of the graphic class and one or more file masks which represent files for the specified type.
GraphicClass is a TGraphicClass type which identifies the image class type for the requested filter value. It can be one of the graphic classes like TBitmap, TCursorImage, TIcon, TPNGImage, TJPEGImage, et. al. If TGraphic is passed in the argument, a list with filters for all of the registered image formats is returned.
For example:
sFilter := GraphicFilter(TJpegImage);
Returns:
JPEG Files (*.jpeg;*.jpg;*.jpe;*.jfif)|*.jpeg;*.jpg;*.jpe;*.jfif
While:
sFilter := GraphicFilter(TGraphic);
Returns:
Graphic (*.png;*.xpm;*.bmp;*.cur;*.ico;*.icns;*.jpeg;*.jpg;*.jpe;*.jfif;*.tif;*. tiff;*.gif;*.pbm;*.pgm;*.ppm)|*.png;*.xpm;*.bmp;*.cur;*.ico;*.icns;*.jpeg;*.jpg; *.jpe;*.jfif;*.tif;*.tiff;*.gif;*.pbm;*.pgm;*.ppm| PNG Files (*.png)|*.png| Pixmap Files (*.xpm)|*.xpm| Bitmap Files (*.bmp)|*.bmp| Cursor Files (*.cur)|*.cur| Icon Files (*.ico)|*.ico| macOS Icon Files (*.icns)|*.icns| JPEG Files (*.jpeg;*.jpg;*.jpe;*.jfif)|*.jpeg;*.jpg;*.jpe;*.jfif| Tagged Image File Format Files (*.tif;*.tiff)|*.tif;*.tiff| Graphics Interchange Format Files (*.gif)|*.gif| Portable Pixmap Files (*.pbm;*.pgm;*.ppm)|*.pbm;*.pgm;*.ppm
Remark: | Formatted for readability; the return value is a string without line breaks. Content depends on the images types supported on a given platform. |
The return value can be used to set the Filter property in dialogs like TFileDialog, TOpenDialog, and TSaveDialog. It contains localized description(s) for the graphic class(es) and a delimited list of file mask(s) compatible with the class type(s).
Use GraphicFileMask to get a delimited list of file masks for a graphic class type without the descriptive text.
Use GraphicExtension to get a single file extension (without the leading '.') for a graphic class type.
|
Abstract base class used for images in supported image formats. |
|
|
TGraphicClass - class of TGraphic. |
|
|
Implements an icon image type; small images typically associated with applications, controls, etc. |
|
|
Implements a macOS Icon Resource file. |
|
|
TCursorImage - an Icon to be used to represent a cursor. |
|
|
Implements a FCL-compatible reader/writer for a Bitmap image. |
|
|
TJPEGImage - a class for handling images stored in JPEG (compressed) format. |
|
|
Implements support for the PNG image format. |
|
|
Implements an image which supports for the Portable Any Map (PNM) graphic format. |
|
|
Implements support for the XPM (Pixmap) image format. |
|
|
Implements support for the TIFF (Tag Image File Format) graphic format. |
|
|
Implements an image using the GIF (Graphics Interchange Format) image format. |
|
|
A string which contains available filename filters used to select files by their file extensions. |
Version 4.0 | Generated 2025-05-03 | Home |