Could give me a simple complete sample about drawing Pixel in Gnome..plz
- From: "金" <unto pchome com tw>
- To: <gtk-app-devel-list gnome org>
- Subject: Could give me a simple complete sample about drawing Pixel in Gnome..plz
- Date: Fri, 5 Nov 2004 23:53:22 +0800
Hello ,
I am new to study the GTK 2.0 and I have a book of "Beginning.Linux.Programming.3rdEd"
But it isn't mention about image processing.So I go to www.gtk.org web site ,tutorial document also no
mention.
I find some example ,that can show "image file" , below is my subfunction to show image.
I also read something about "pixel buffer function" at GTK relative web site,but it's not structure ,don't
have example.
I don't know how to use that.
so...Could give me simple complete program,about how to show pixel in screen(if I have pixel array,and RGB
palette array) .
Thanks a lots.
Regards.
Unto
**********************************************************************
void showimage(char *windowsTitle,char *file)
{
GtkWidget *subwindow;
GtkWidget *image;
subwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW(subwindow), windowsTitle);
gtk_window_set_position(GTK_WINDOW(subwindow),GTK_WIN_POS_CENTER);
g_signal_connect (G_OBJECT (subwindow), "destroy",
G_CALLBACK (gtk_main_quit),
NULL);
image = gtk_image_new_from_file (file);
gtk_container_add (GTK_CONTAINER (subwindow), image);
gtk_widget_show_all (subwindow);
gtk_main ();
}//show image end.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]