[Gtk-sharp-list] Re: Improving Gtk#
Miguel de Icaza
Sun, 01 May 2005 13:21:21 -0400
> > * What kind of samples are missing?
> I'm looking for the features to implement a right-to-left, smooth-scrolling
> graph displaying real-time data. I have an (old) Win32 application which uses
> low-level stuff like BitBlt's etc to achieve this. I'm not sure at what level I
> could implement the same thing in Gtk#, or whether other Gnome (GnomeCanvas?)
> stuff is needed, though I need it to work on both linux and Win32.
If you have a working program that use BitBlt, you can do the same thing
on Gtk# with the portable stuff quite easily.
You can use:
Gdk.Drawable.DrawPixbuf (GC gc, Pixbuf pixbuf, int src_x,
int src_y, int dest_x, int dest_y,
int width, int height, RgbDither dither,
int x_dither, int y_dither)
You will actually do your drawing on top of the `pixbuf' buffer (which
is just a square region where you do your drawing) and the above routine
is used to transfer it into a Drawable.
GnomeCanvas is just a "retained" graphics model. You dump objects on it
and you can later control the properties of the objects without having
to worry about repainting it yourself, very much like the DOM on the Web
`Line XX, turn yourself red, and get thicker by 3 pixels' kind of