Re: Rotating an NSView before printing
Re: Rotating an NSView before printing
- Subject: Re: Rotating an NSView before printing
- From: Buddy Kurz <email@hidden>
- Date: Sat, 28 Apr 2007 10:14:20 -0700
I wrote a printer emulation view that needed to rotate itself for
landscape printing.
In the init method, I create and retain a NSAffineTransform to handle
he rotation
toLandscape = [[NSAffineTransform transform] retain];
//we move down and then rotate
[toLandscape translateXBy:0 yBy:[self frame].size.height];
[toLandscape rotateByDegrees:-90];
In the drawRect: method, I apply the transform if needed
//each new page needs to have transformation applied
if (isLandscape) {
[toLandscape concat];
}
//draw stuff
On Apr 28, 2007, at 6:16 AM, James Williams wrote:
...
I've spent the last two weeks fighting with this and I've almost
got it
working, but I'm missing something. I also think I might be making
it too
hard so any advice that you have would be really appreciated!
I've simplified my code to just draw a border around the entire
envelope. I
think that if I get that working, all of my other code will work as
well.
Right now, it prints inverted (correct), but the border for my view
is a few
points off of the edge of the page so the entire thing is unable to
fit on
the physical envelope (it bleeds off the edge of the right side but
is all
white space on the left side).
I hope I haven't included too much introduction or code, but I'm
not sure
which of my functions is the problem (maybe all of them are).
Thanks in advance!
--James
...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden