🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #782

Problem with NXImage

#782
From: hoffmann
Date: Wed, 26 Aug 1992 09:16
38 lines
1883 bytes
I have a problem with NXImage that is hurting me for days
now and I cannot find a solution.
I'm working on a drawing program which allows you to draw
on top of a background representing a map. The map is a tiff
image hold in a NXImage object.

[self convertRect:&mapDrawRect toView:[window contentView]];

....// now I'm calculating a offset for mapDrawRect  

[mapImage composite:NX_SOVER fromRect:&mapDrawRect toPoint:&aPoint];

is causing the following problem:
Since NXImage specifies its rects in base coordinates and my 
drawing view can be scaled I have to convert mapDrawRect to the
base coordinate system and then do the compositing.
Everything works fine when the drawing view is scaled to 
50%,100%,200%,400%,...

When scaled to 25%,75%,150%,300%,...
the result of the compositing differs from the one I wish 
by one pixel row (or sometimes column, I couldn't find a rule in this).
Sometimes it's the size that's too small (or too large) sometimes
the offset is offset with one pixel row(or column).

aPoint is in drawing view coordinates (which is focused, BTW
this is part of the drawSelf method).

Everytime I scale the drawing view (and resize it accordingly)
I resize the NXImage object such that it has the same size with the
drawing view in base coordinates (the NXImage is set to scalable).

I'll appreciate any help or example code using NXImage in similar
situations.

Uwe,

hoffmann@fzi.de
Technical Details
Message-ID: <1992Aug26.091615.10520@fzi.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!gate.fzi.de!news

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!gate.fzi.de!news
From: hoffmann@fzi.de
Subject: Problem with NXImage
Message-ID: <1992Aug26.091615.10520@fzi.de>
Keywords: NXImage,compositing
Sender: news@fzi.de (FZI-news)
Reply-To: hoffmann@fzi.de
Organization: FZI Forschungszentrum Informatik, Karlsruhe, Germany
Date: Wed, 26 Aug 1992 09:16:15 GMT
Lines: 38