home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!caen!batcomputer!snake.tc.cornell.edu!reed
- From: reed@snake.tc.cornell.edu (Michael G. Reed)
- Subject: A tricky PICT problem...
- Message-ID: <1992Aug12.165953.11374@tc.cornell.edu>
- Followup-To: comp.sys.mac.programmer
- Keywords: PICT
- Sender: news@tc.cornell.edu
- Nntp-Posting-Host: snake.tc.cornell.edu
- Reply-To: reed@Theory.TC.Cornell.EDU
- Organization: Cornell National Supercomputing Facility
- Date: Wed, 12 Aug 1992 16:59:53 GMT
- Lines: 39
-
- Netters:
- I have an interestin problem here. In an application I'm writing, I
- have a PICT file that I just spooled to a disk (Assuming it got there, and
- the file is correctly formatted, which it is), I now need to read that file
- back into a pixmap a portion at a time (eg, in 100 line chunks). Yes, I know
- this sounds inefficient, but if I have a final image that's 2048x2048x32deep,
- I cannot get enough memory to read it all at once. I setup the CGrafPort
- with a pixmap that is the maximum size I can read in (getting memory from the
- TempMem pool). I then proceed to read the pict file in (entirely), save the
- pixmap, and repeat until I have processed all 2048 lines (again, I try to do
- it in as large chunks as possible). Now, the routine appears to be
- functioning correctly (eg, it passes through the PICT file the correct number
- of times, and it is saving the pixmap correctly), the only problem is that I
- get a blank output file. Arg! I think I might have my various ports
- misaligned, thus creating a situation where the mac cannot draw anything, but
- I cannot find the misalignment. I setup the ports as follows:
-
- SetPort (graf);
- InitCPort (graf);
- /* various other setup routines for picture/port */
- pixmap.bounds = master_rect;
- ClipRect (&temp_rect);
- RectRgn (graf->visRgn, &temp_rect);
- DrawPicture (pict_handle, &master_rect);
-
- Where master_rect is (top=0,left=0,bottom=2048,right=2048)
- temp_rect os (top=VAR,left=0,bottom=VAR+LINES,right=2048)
- Where VAR is the current "top most line" to render
- LINES is the hight of the pixmap (lines to render).
-
- Something must be wrong here...Any help would be greatly appreciated.
-
- -----------------------------------------------------------------------------
- Michael G. Reed (reed@Theory.TC.Cornell.edu)
- Cornell National Supercomputing Facility (607)/254-8806
- -----------------------------------------------------------------------------
- Why be normal, it's boring; and boring people should be shot.
-
- Note: These are not the views of my employer (and probably not mine either).
-