RE: Drawing jpg files



  


-----Original Message-----
From: Shiraz Baig [mailto:shiraz_baig yahoo com]
Sent: Wednesday, June 15, 2005 12:31 PM
To: gtk-list gnome org
Subject: Drawing jpg files


I wish to show a jpg file in the user interface.
What widget do I use and what function call do I use.
I tried an image widget But it does not show jpg
files.
bye
shiraz



Hi Shiraz,
            You can use the GtkDrawingArea Widget for Display, and GdkPixBuf
for holding the Image data ,

 1.) Create a Drawing Area
 2.) Add to your main application Window
 3.) Connect the Signal handlers to the Drawing Area , like Configure-event,
expose-event etc.
 4.) In the expose event, use gdk_pixbuf_new_from_file , check for Error

 
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-file-loading.ht
ml

 5.) After you get the PixBuf returned here , you can get the height,
Rowstride and width of the image from Pixbuf,
 6.) You should now get the pixels get_pixels or something, there is a call
to get pixels array from the 
     Pixbuf( Consult Documentation of GdkPixBuf) 

 7.) gdk_draw_rgb_image --> can now be used to draw the raw data on the
screen,


Note: I used it sometime back , and i do not remember the names of the
functions fully !
Hope it helps .

Cheers.
Simith

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list

______________________________________________________________________
This email has been scanned via a message filtering facility.
If you have any issues with your email, please contact the IT Dept.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]