[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can an image be persistent with imshow or figure (II) ?
From: |
Muthiah Annamalai |
Subject: |
Re: Can an image be persistent with imshow or figure (II) ? |
Date: |
Tue, 19 Jul 2005 21:27:56 -0700 (PDT) |
Hello there!
I dont know if what youre looking for is, Octave-GTK+,
but have a look at this site:
http://octave-gtk.sf.net/ and our project. I hope my
project is useful for you.
For an idea see
http://octave-gtk.sourceforge.net/screenshot.html
Octave-GTK+ is a set of GTK+ bindings for Octave.
They are unstable, but work, in some hackish way.
You can use this code to show a image, in a persistent
way.
---------------------------------------------
#! /usr/bin/octave -q
% (C) July 2005, Muthiah Annamalai
<gnumuthu-at-users-nospam-sf-spamno-net>
%
% Ensure:
%
%matrix you pass to gtk_imshow_set() has only
% elements with normalized to value [0,1].
%
%size of window must be set explicitly, to greater
%than that of your ImageShow[drawing area] widget
%
%get the ImShow widget using, gtk_imshow_get_da(x),
%and use this as real widget handler. this interface
%will change in future.
disp('Simple GTK+ Image Show example');
x=0
function timeout()
global x
disp('Timeout')
gtk_imshow_set(x,rand(256));
gtk_widget_queue_draw(gtk_imshow_get_da(x));
end
function main()
global x;
gtk()
gtk_init()
w=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtkimshow()
disp('ImShow Creating')
x=gtk_imshow_new(200,200);
disp('ImShow Created')
img=rand(256);
gtk_imshow_set(x,img);
gtk_timeout_add(2000,"timeout"); %keep changing
images every 2 seconds.
g_signal_connect(w,"destroy","gtk_main_quit");
gtk_container_add(w,gtk_imshow_get_da(x));
gtk_window_set_default_size(w,300,300);
gtk_widget_show(gtk_imshow_get_da(x));
gtk_widget_show_all(w);
gtk_main();
end
main()
--------------------------------------------------
To use this program you need octave-gtk+ and
[http://sourceforge.net/projects/octave-gtk/]
the imshow.tgz package from
[http://octave-gtk.sf.net/imshow.tgz]
Ive added a screenshot here:
[http://octave-gtk.sf.net/imshow.png].
Cheers
Muthu
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------