drawing grids fast
- From: "Vassilios V . Dimakopoulos" <dimako cs uoi gr>
- To: gtk-app-devel-list gnome org
- Subject: drawing grids fast
- Date: Mon, 25 Feb 2002 15:02:03 +0200
Hello all,
here is my "simple" question: I write a vector drawing application
which has a drawing area and a backing pixmap. The user may select
to show/hide grid lines or points.
What would be the best way to draw the grid?
I have tried two basic methods:
(1) drawing expicitely horizontal/vertical lines on the pixmap and then
copying it onto the drawing area: relatively slow since the grid can
be quite dense; gdk_draw_segments() is useful, but the speed difference
is not that high. (also, what if the user wants a point grid ?)
(2) filling the pixmap with small horizontal & vertical pixmaps, which if
manipulated correctly (XOR operations, etc) produce the final line/point
grid.
This is faster than (1) when the window is relatively small.
For bigger windows, it gets too slow.
The slowdown shows up when scrolling, where everything gets repainted.
I have noticed, however, that e.g. Kontour has no speed penalties when the
grid is turned on.
Does anyboby have a suggestion?
--
VASSILIOS V. DIMAKOPOULOS Office: +30-6510-98809
Department of Computer Science Fax: +30-6510-98890
University of Ioannina E-mail: dimako cs uoi gr
P.O.Box 1186, Ioannina WWW: http://www.cs.uoi.gr/~dimako
GR-45110 Greece ............................
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]