diff options
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r-- | src/FbTk/FbPixmap.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc index bbc8fcb..cac6cf0 100644 --- a/src/FbTk/FbPixmap.cc +++ b/src/FbTk/FbPixmap.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbPixmap.cc,v 1.10 2004/01/11 12:48:46 fluxgen Exp $ | 22 | // $Id: FbPixmap.cc,v 1.11 2004/07/05 23:51:57 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbPixmap.hh" | 24 | #include "FbPixmap.hh" |
25 | #include "App.hh" | 25 | #include "App.hh" |
@@ -248,6 +248,28 @@ void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) { | |||
248 | m_pm = new_pm.release(); | 248 | m_pm = new_pm.release(); |
249 | } | 249 | } |
250 | 250 | ||
251 | void FbPixmap::tile(unsigned int dest_width, unsigned int dest_height) { | ||
252 | if (drawable() == 0 || | ||
253 | (dest_width == width() && dest_height == height())) | ||
254 | return; | ||
255 | |||
256 | Display *dpy = FbTk::App::instance()->display(); | ||
257 | |||
258 | FbPixmap new_pm(drawable(), width(), height(), depth()); | ||
259 | |||
260 | new_pm.copy(m_pm); | ||
261 | |||
262 | resize(dest_width,dest_height); | ||
263 | |||
264 | GC gc = XCreateGC(dpy, drawable(), 0, NULL); | ||
265 | |||
266 | XSetTile(dpy,gc,new_pm.release()); | ||
267 | XSetFillStyle(dpy, gc, FillTiled); | ||
268 | XFillRectangle(dpy,drawable(),gc, 0, 0, dest_width, dest_height); | ||
269 | } | ||
270 | |||
271 | |||
272 | |||
251 | void FbPixmap::resize(unsigned int width, unsigned int height) { | 273 | void FbPixmap::resize(unsigned int width, unsigned int height) { |
252 | FbPixmap pm(drawable(), width, height, depth()); | 274 | FbPixmap pm(drawable(), width, height, depth()); |
253 | *this = pm.release(); | 275 | *this = pm.release(); |