Re: [newbie] How to plot to drawing_area



On Sun, 2 Feb 2003 12:23:03 -0300
"Individual . ." <individual mi cl> wrote:


On Sunday, February 2, 2003, at 09:57 AM, Roland Smith wrote:

Plotting pixel by pixel is _slow_. It's better to use GdkRGB, e.g. 
using
gdk_draw_rgb_image(). What you have to do is read from the png file to 
a buffer
containing an array of rgb values. This is then drawn to a drawable. 
See the
example in the GDK manual.


Ah! yes, speed is important.

I shall look at that example. I've also started learning about Xlib and 
making a window directly, bypassing Gtk, and I seem to be close to 
achieving what I want. That said, I really don't know if what I am 
doing is at all efficient.

I've used Xlib and Athena before switching to GTK+, and IMHO it isn't pretty.
:-( Especially if you want it to work on all available colordepths etc.

For me, I would only use Xlib if I was on a platform that was slow or very
resource constrained, and if a proper GUI was not necessary, i.e. you just want
to show a picture or movie.

Roland
-- 
R.F. Smith                           /"\    ASCII Ribbon Campaign
r s m i t h @ x s 4 a l l . n l      \ /    No HTML/RTF in email
http://www.xs4all.nl/~rsmith/         X     No Word docs in email
                                     / \    Respect for open standards

Attachment: pgpwDsAcw2ah0.pgp
Description: PGP signature



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