问题
I'm using a pixmap as a window's backup in order to restore it under expose events. When the window is resized, must I resize the backup pixmap?
If so, what is the best way? Create a new pixmap with the new size?
回答1:
Yes you are right.
If the window is resized to a smaller size you just clip it.
If the window is bigger you allocate again to the new size.
My advice would also be to look at
- xcb which replaces xlib at the moment
- xshm functions for faster performance
- Xrender/cairo/clutter that may do what you want already
来源:https://stackoverflow.com/questions/1222631/how-to-resize-a-pixmap-with-xlib