forked from AuroraMiddleware/gtk
Add another symbolic pixbuf helper
This commit is contained in:
parent
c3de5e3624
commit
3c219bf968
@ -63,6 +63,11 @@ GdkPixbuf *gtk_make_symbolic_pixbuf_from_file (GFile *file,
|
||||
int height,
|
||||
double scale,
|
||||
GError **error);
|
||||
GdkPixbuf *gtk_make_symbolic_pixbuf_from_path (const char *path,
|
||||
int width,
|
||||
int height,
|
||||
double scale,
|
||||
GError **error);
|
||||
GdkPixbuf *gtk_make_symbolic_pixbuf_from_resource (const char *path,
|
||||
int width,
|
||||
int height,
|
||||
|
@ -425,6 +425,27 @@ gtk_make_symbolic_pixbuf_from_resource (const char *path,
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
gtk_make_symbolic_pixbuf_from_path (const char *path,
|
||||
int width,
|
||||
int height,
|
||||
double scale,
|
||||
GError **error)
|
||||
{
|
||||
char *data;
|
||||
gsize size;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
if (!g_file_get_contents (path, &data, &size, error))
|
||||
return NULL;
|
||||
|
||||
pixbuf = gtk_make_symbolic_pixbuf_from_data (data, size, width, height, scale, error);
|
||||
|
||||
g_free (data);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
gtk_make_symbolic_pixbuf_from_file (GFile *file,
|
||||
int width,
|
||||
|
Loading…
Reference in New Issue
Block a user