Re: How does the "print screen" function work?



Thanks, Evan...

As my application runs on a pda, the user won't be able to drag the window around, so pasting the screenshot as the background is pretty safe for me :-) With reference to gnome-panel-screenshot source code, I used gdk_pixbuf_get_from_drawable combined with gdk_get_default_root_window and gdk_pixbuf_render_to_drawable (or gdk_draw_pixbuf).
Your idea of hacking is interesting, I will try it out next time....

Regards,

hamb


From: Evan Martin <martine cs washington edu>
To: hamb ka <hamb_ msn com>
CC: gtk-app-devel-list gnome org
Subject: Re: How does the "print screen" function work?
Date: Tue, 20 May 2003 01:28:25 -0700

On Tue, May 20, 2003 at 03:27:54PM +0900, hamb ka wrote:
> I am writing an application which is supposed to have some kind of
> transparent effect. So I am considering of using the screenshot as the
> background of this application.
> "print screen" needs gnome libraries, right? which one?

Truly transparent windows are currently impossible with x.
If you take a screenshot of the screen and then use it to fill your
window, you won't be able to take future screenshots to update the
background because your window is covering the spot you're trying to
take a picture of.

To get a pixbuf from the screen, use gdk_pixbuf_xlib_get_from_drawable():
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.html

I've written some more about the hacks related to transparency here:
 - http://evan.livejournal.com/590245.html
and wrote how I've managed to make a pseudo-transparent (but more real
than transparent terminals) hack here:
 - http://evan.livejournal.com/591456.html

I didn't go much farther than that, though.

--
      Evan Martin
martine cs washington edu
  http://neugierig.org
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_________________________________________________________________
Find gifts, buy online with MSN Shopping. http://shopping.msn.com.sg/




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