Re: NSImage origin
Re: NSImage origin
- Subject: Re: NSImage origin
- From: Don Willems <email@hidden>
- Date: Thu, 23 Sep 2004 09:17:19 +0200
Thanks,
Off the top of my head, try adding:
NSPoint myOrigin = [self bounds].origin;
[[[NSAffineTransform transform] translateXBy: - myOrigin.x yBy:
-myOrigin.y] concat];
Yes that worked ... almost!
But I got signal 11 (SIGSEGV) errors.
So I changed my code to:
image = [[[NSImage alloc] initWithSize:cropped.size]
autorelease];
[image lockFocus];
NSPoint myOrigin = cropped.origin;
NSAffineTransform *translate = [NSAffineTransform transform];
[translate translateXBy: -myOrigin.x yBy: -myOrigin.y];
[translate set];
[self drawViewRect:cropped];
[image unlockFocus];
and it works!
Again, thanks,
Don
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden