simple example of using gdk_pixbuf_new_from_file
- From: Dehua Zhao <dzhao cs uno edu>
- To: <gtk-app-devel-list gnome org>
- Subject: simple example of using gdk_pixbuf_new_from_file
- Date: Mon, 9 May 2005 09:02:09 -0500 (CDT)
#include<gtk/gtk.h>
#include<gdk-pixbuf/gdk-pixbuf.h>
#include <stdlib.h>
#include<string.h>
#include<stdio.h>
#include<string.h>
int main(int argc, char *argv[])
{
GError *gerror;
GdkPixbuf *originalpb, *pb;
GdkPixbuf *rpb, *ipb;
char filename[20];
gtk_set_locale ();
gtk_init (&argc, &argv);
strcpy(filename, argv[1]);
originalpb = NULL;
originalpb=gdk_pixbuf_new_from_file(inputimg,&gerror);
if(!originalpb) {
printf("error message: %s\n", gerror->message);
exit(1);
}
....
hei = gdk_pixbuf_get_height(originalpb)/downsampling;
wid = gdk_pixbuf_get_width(originalpb)/downsampling;
gdk_pixbuf_unref(originalpb);
....
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]