Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!usc!apple!agate!ucbvax!dash.mitre.org!russ From: russ@dash.mitre.org (Russell Leighton) Newsgroups: comp.windows.news Subject: Canvas sizes Message-ID: <8911071758.AA12039@dash.mitre.org> Date: 7 Nov 89 23:03:12 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 53 Thanks for your response: >In xnews, `readcanvas' scales the images to the unit square. >Given this how do I find out what the actual size of >the canvas is? I cannot use `getcanvasshape pathbbox' >because it will return 0 0 1 1. Do the following (assume can is the result of readcanvas): gsave can setcanvas 1 1 dtransform abs exch abs grestore The result will be the width and height of the canvas. Note that I used the undocumented (at least in the pre-FCS documentation) function 'abs' in both numbers although only the height will be negative. This is because I don't know if NeWS 3.0 will have its internal origin in the upper right hand corner, due to some X.12 requirements. {:-) Rafael Bracho rxb@asc.slb.com This is another response I got: Try something like this: readcanvas % c dup % c c setcanvas % c initclip clippath pathbbox % c x y w h This works under 1.1, but not under xnews. In fact, it causes a horrible crash under a beta version of xnews. Instead, use the new call, getbbox: readcanvas dup % c c false getbbox % c x y w h John Martin Philips Labs jcm@philabs.philips.com tel (914) 945-6406 Russ.