Re: [gtk-list] clip origin, and **clip mask origion** ??



>I have an xpm file with multiple pixmaps on it. I am drawing a new pixmap
>by copying the smaller pictures out of the xpm file to the new pixmap.
>I have encountered what I figure has a simple solution but of which I have
>not found. Clipping the origin on the loaded xpm appears to solve the
>drawing problem and I can copy it but the mask still remains the original.
>So if the xpm has a circle in the top left 40x40 square and I'm trying to
>copy a 40x40 square that is in the bottom right it will copy the right
>information but the mask is still a circle.

use with appropriate offsets on where to start the pixmap data and how
large it is. For example, suppose you had a rectilinear array of
N images in your pixmap, each one PxP pixels in size. You can draw the Nth
image like this:

	gdk_draw_pixmap (some_window, some_gc, the_pixmap,
		         N*(kp&(N-1)), 0, 0, 0, P, P);

I should mention my debt to the author of gsyn, Andy Sloane
<andy@guildsoftware.com>, for this "trick".

--p



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