Drawing into an NSImage
Drawing into an NSImage
- Subject: Drawing into an NSImage
- From: "Gary J.H. Atkinson" <email@hidden>
- Date: Wed, 17 Dec 2003 14:02:24 +0000
I have a large(ish) diagram which I want to render into an NSImage to
create a small mimic.
I lock the focus on the image, set a scaling matrix to reduce the size
of the diagram to fit the image.
Bezier paths and images render fine, but there is a problem with text.
I'm using
drawAtPoint: withAttributes:
from NSString Additions.
The documentation states that this should only be used on an NSView
which has the focus locked on it. It does render to an NSImage but only
if the string would appear within the 'frame' of the image, i.e. the
actual size of the ImageRep. It doesn't take into account the fact that
I've applied a transformation to the context. So only text placed
around then top-left of the diagram renders, (the NSImage is flipped).
Any suggestions for a workaround other than creating a large image the
size of the diagram and then reducing that.
--
Gary J.H. Atkinson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.