Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: hsc@vuse.vanderbilt.edu (Hsuan Chang) Newsgroups: comp.sys.sun Subject: Re: How to save raster to file from canvas Keywords: Windows Message-ID: <8903100548.AA01275@ip3> Date: 23 Mar 89 10:23:10 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 16 Approved: Sun-Spots@rice.edu Original-Date: Thu, 9 Mar 89 23:48:49 CST X-Sun-Spots-Digest: Volume 7, Issue 207, message 10 of 15 >I'd like some advice with what seems like a simple idea. Given a canvas >with its pixwin, how can I just get at the raw bits of the image so as to >save it to a disk file and later reload it into the same pixwin? Note >that the rectangle size and shape will not change. Well, you might want to use the pixrect substructure of the pixwin directly. It's accessable via pw->pw_prretained, which is a pointer to a pixrect structure. It has everything that you have on the canvas. You can then go in to access the raw data part (one dimensional array of type *short*, each holding two pixels of 8 bits each). Hope this helps. Hsuan Chang hsc@vuse.vanderbilt.edu Image Processing Lab, Computer Science Department Vanderbilt University, Nashville, Tn 37235