How to resize a pixmap with XLib?

不想你离开。 提交于 2019-12-11 02:35:37

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!