Skip navigation.
 
mlRe: Problems with NSAffineTransform
FROM : Laurent Daudelin
DATE : Wed Jul 26 04:49:03 2006

On Tue, 25 Jul 2006 08:46:10 -0700, Henry McGilton wrote:

> On Jul 24, 2006, at 10:59 PM, Laurent Daudelin wrote:
>

>> Hello.
>>
>> I just recently started playing with Quartz, CI and the likes, so be gentle!
>>
>> I'm setting up a slide show in a window using a subclass of NSImageView,
>> based partly on code from the documentation and partly from code from the
>> FunHouse project.
>>
>> I use an instance of NSAffineTransform with a CoreImage 'CIAffineTransform'
>> filter to scale the image to the size of the window and to center it in the
>> window.
>>
>> The scaling part works well but the translations don't for some reason. I
>> did test my code with a bunch of various pictures of different types. When
>> I'm not trying to translate the x and y coordinates, everything is fine. As
>> soon as I start using translateXBy:yBy:, then some pictures appear 10 times
>> as large as they appear when no translation is performed and all pictures
>> will generally be off, relative to the center, by a various amount of
>> pixels. If I use a set of pictures of the same time and the same size, they
>> will all appear at the same x,y coordinate, but they won't be centered
>> either.

>
>
> Try doing the  translate  *before*  you do the  scale


Henry,

Thanks a million! That was it! All pictures are centered properly now. Even
the page curl transition I've tried using when transitioning and was
generating an exception now works perfectly!

Thanks again!

-Laurent.
--
============================================================================
Laurent Daudelin  AIM/iChat: LaurentDaudelin    <http://nemesys.dyndns.org>
Logiciels Nemesys Software              mailto:laurent.<email_removed>

Sometimes the majority only means that all the fools are on the same side.

Related mailsAuthorDate
mlProblems with NSAffineTransform Laurent Daudelin Jul 25, 07:59
mlRe: Problems with NSAffineTransform Henry McGilton Jul 25, 17:46
mlRe: Problems with NSAffineTransform Laurent Daudelin Jul 26, 04:49