home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 13883 < prev    next >
Encoding:
Text File  |  1992-08-12  |  2.5 KB  |  54 lines

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