Re: [gtk-list] handling pixmaps



On 15 Apr, Tony Gale shouted:
->  
->  Would some kind sole explain the mysteries of pixmaps to me. I
->  basically want to plot position's onto a map. So, I have a contour
->  map in xpm format, and have created a drawing area to plot it on and
->  a backing pixmap to save on flicker.
->  
->  So, the process (I think) would be to copy the map pixmap onto the
->  backing pixmap, and then plot the positions (as circles or whatever)
->  over the top - and then copy this backing pixmap to the drawing area
->  (and handle expose event's).

1. greate a drawing area
create your pixmap
set the drawing area's window background pixmap to the pixmap.
draw whatever you want in the draing area.
when youw ant to wipe an area of the drawing area clean so it has just
got the backgroudn pixmap again clear the area

the functions you want to look at are:

gdk_window_clear
gdk_window_clear_area
gdk_window_set_back_pixmap
gtk_drawing_area_new

->  Repeat when the positions change.
->  
->  If someone could show me how to do this I would be most grateful.
->  Also, the loading of the map pixmap takes an age (using both
->  gdk_pixmap_create_from_xpm and gdk_pixmap_create_from_xpm_d), how can
->  I speed this up?

use imlib. :)

->  Thanks
->  
->  Tony
->  --
->  E-Mail: Tony Gale <gale@daedalus.dera.gov.uk>
->  Nothing is as simple as it seems at first
->          Or as hopeless as it seems in the middle
->                  Or as finished as it seems in the end.
->  
->  The views expressed above are entirely those of the writer
->  and do not represent the views, policy or understanding of
->  any other person or official body.
->  

-- 
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
raster@rasterman.com       /\___ /\ ___/||\___ ____/|/\___  raster@redhat.com
Carsten Haitzler           | _ //__\\ __||_ __\\ ___|| _ /  Red Hat Advanced
218/21 Conner Drive        || // __ \\_ \ | |   \ _/_|| /   Development Labs
Chapel Hill NC 27514 USA   ||\\\/  \//__/ |_|   /___/||\\   919 547 0012 ext 282
+1 (919) 929 9443, 801 4392   For pure Enlightenmenthttp://www.rasterman.com/ 



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