On Sat, 2003-09-06 at 09:16, Tor Lillqvist wrote:
> Henrik Brix Andersen writes:
>  > It would be nice if someone on say... win32 ;)... would have a go at
>  > writing the missing win32 part of the select_window() function.
> I get the hint ;-). I'll have a look at it. 

Hehe - was the hint that obvious?

> Grabbing the whole screen with screenshot (without any Win32 specific
> code yet) was *much* slower than with winsnap. It was the image
> transfer phase from the plug-in to GIMP that was a lot slower. I tried
> to change the code to just call gimp_pixel_rgn_set_rect() once, like
> winsnap does, instead of calling gimp_pixel_rgn_set_row() in a
> loop. And it is now much speedier. Do you see any reason why this
> should not be done? (Maybe also call gimp_tile_cache_size(), although
> calling it like winsnap.c does results in black screendumps, oddly
> enough.)

Using gimp_pixel_rgn_set_row() may work for some images, but since
GdkPixbufs internally have aligned data which may result in padding
garbage inserted between two rows, you will need to use
gdk_pixbuf_get_rowstride() and iterate over the rows one by one.

If you can come up with a better (faster?) solution to this problem
please don't hesitate to commit it.

>  > When the win32 specific part of select_window() has been written and
>  > committed I plan to retire the win32 specific winsnap plug-in in favor
>  > of the new screenshot plug-in.
> BTW, shouldn't it be possible to write select_window() using only GDK?
> gdk_pointer_grab() and, hmmm, well I'll think about it.

Unfortunately this doesn't seem to be possible. Believe me, I've tried
:(. Since GDK knows nothing about other programs windows there is no way
of obtaining the window ID (XID or HWND) for these using plain GDK.

I have close to no experience in MS Windows programming, but using Xlib
you can use the subwindow member of the Xevent struct to get the ID of
the window which recieved the event. GDK events structs has no such

> (Wonder why it seems to take so long for messages to go through
> [EMAIL PROTECTED] Two or three days. Sobig.F?)

Nope. Apparently lists.xcf.berkeley.edu is running low on RAM - please
see http://bugzilla.gnome.org/show_bug.cgi?id=121086

Henrik Brix Andersen <[EMAIL PROTECTED]>

Gimp-developer mailing list

Reply via email to