home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / next / programm / 5798 < prev    next >
Encoding:
Text File  |  1992-08-25  |  1.8 KB  |  51 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!gate.fzi.de!news
  3. From: hoffmann@fzi.de
  4. Subject: Problem with NXImage
  5. Message-ID: <1992Aug26.091615.10520@fzi.de>
  6. Keywords: NXImage,compositing
  7. Sender: news@fzi.de (FZI-news)
  8. Reply-To: hoffmann@fzi.de
  9. Organization: FZI Forschungszentrum Informatik, Karlsruhe, Germany
  10. Date: Wed, 26 Aug 1992 09:16:15 GMT
  11. Lines: 38
  12.  
  13. I have a problem with NXImage that is hurting me for days
  14. now and I cannot find a solution.
  15. I'm working on a drawing program which allows you to draw
  16. on top of a background representing a map. The map is a tiff
  17. image hold in a NXImage object.
  18.  
  19. [self convertRect:&mapDrawRect toView:[window contentView]];
  20.  
  21. ....// now I'm calculating a offset for mapDrawRect  
  22.  
  23. [mapImage composite:NX_SOVER fromRect:&mapDrawRect toPoint:&aPoint];
  24.  
  25. is causing the following problem:
  26. Since NXImage specifies its rects in base coordinates and my 
  27. drawing view can be scaled I have to convert mapDrawRect to the
  28. base coordinate system and then do the compositing.
  29. Everything works fine when the drawing view is scaled to 
  30. 50%,100%,200%,400%,...
  31.  
  32. When scaled to 25%,75%,150%,300%,...
  33. the result of the compositing differs from the one I wish 
  34. by one pixel row (or sometimes column, I couldn't find a rule in this).
  35. Sometimes it's the size that's too small (or too large) sometimes
  36. the offset is offset with one pixel row(or column).
  37.  
  38. aPoint is in drawing view coordinates (which is focused, BTW
  39. this is part of the drawSelf method).
  40.  
  41. Everytime I scale the drawing view (and resize it accordingly)
  42. I resize the NXImage object such that it has the same size with the
  43. drawing view in base coordinates (the NXImage is set to scalable).
  44.  
  45. I'll appreciate any help or example code using NXImage in similar
  46. situations.
  47.  
  48. Uwe,
  49.  
  50. hoffmann@fzi.de
  51.