[comp.windows.x] Getting the width and height of a Pixmap

smartin@torsys02_1.uucp (Stephen Martin) (01/09/91)

Is there any way to determine the width and height of a Pixmap?  I would like
to only pass an argument of Pixmap to a function and determine it's dimensions
there instead of passing them in as seperate arguments.
--
Stephen Martin               -------    LSI Logic Corporation of Canada, Inc.
Phone: (416) 620-7400     LSI|LOGIC|    Suite 1110, 401 The West Mall,        
Fax:   (416) 620-5005        |     |    Etobicoke, Ontario, Canada.
Email: smartin@lsican.uucp   -------    M9C 5J5
 or    smartin@Canada.lsil.com

mouse@larry.mcrcim.mcgill.EDU (01/10/91)

> Is there any way to determine the width and height of a Pixmap?

From the Xlib document:

	To obtain the current geometry of a given drawable, use
	XGetGeometry.
	
	Status XGetGeometry(display, d, root_return, x_return, y_return, width_return,
	                      height_return, border_width_return, depth_return)
	        Display *display;
	        Drawable d;
	        Window *root_return;
	        int *x_return, *y_return;
	        unsigned int *width_return, *height_return;
	        unsigned int *border_width_return;
	        unsigned int *depth_return;
	
	display   Specifies the connection to the X server.
	
	d         Specifies the drawable, which can be a window or a
	          pixmap.
	
	root_return
	          Returns the root window.
	
	x_return
	y_return  Return the x and y coordinates that define the
	          location of the drawable.  For a window, these
	          coordinates specify the upper-left outer corner
	          relative to its parent's origin.  For pixmaps,
	          these coordinates are always zero.
	
	width_return
	height_return
	          Return the drawable's dimensions (width and
	          height).  For a window, these dimensions specify
	          the inside size, not including the border.
	
	border_width_return
	          Returns the border width in pixels. If the draw-
	          able is a pixmap, it returns zero.
	
	depth_return
	          Returns the depth of the drawable (bits per pixel
	          for the object).
	
	The XGetGeometry function returns the root window and the
	current geometry of the drawable.  The geometry of the draw-
	able includes the x and y coordinates, width and height,
	border width, and depth.  These are described in the argu-
	ment list.  It is legal to pass to this function a window
	whose class is InputOnly.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (01/10/91)

In article <SMARTIN.91Jan9090758@torsys02_1.uucp>, smartin@torsys02_1.uucp (Stephen Martin) writes:
|> Is there any way to determine the width and height of a Pixmap?  I would like
|> to only pass an argument of Pixmap to a function and determine it's dimensions
|> there instead of passing them in as seperate arguments.
|> --

XGetGeometry
--
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bcm.tmc.edu
					(713) 798-3776