Constructor
GtkImagenew_from_file
Declaration [src]
GtkWidget*
gtk_image_new_from_file (
const char* filename
)
Description [src]
Creates a new GtkImage
displaying the file filename
.
If the file isn’t found or can’t be loaded, the resulting GtkImage
will display a “broken image” icon. This function never returns NULL
,
it always returns a valid GtkImage
widget.
If you need to detect failures to load the file, use an
image loading framework such as libglycin to load the file
yourself, then create the GtkImage
from the texture.
The storage type (see gtk_image_get_storage_type()
)
of the returned image is not defined, it will be whatever
is appropriate for displaying the file.
Parameters
filename
-
Type:
const char*
A filename.
The data is owned by the caller of the function. The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.
Return value
Type: GtkWidget
A new GtkImage
.
The data is owned by the called function. |