Re: How to draw a rectangle around a (graph) view?
Re: How to draw a rectangle around a (graph) view?
- Subject: Re: How to draw a rectangle around a (graph) view?
- From: "Arthur C." <email@hidden>
- Date: Wed, 25 Apr 2007 19:29:23 +0200
From: "Shawn Erickson" <email@hidden>
To: "Arthur C." <email@hidden>
CC: email@hidden
Subject: Re: How to draw a rectangle around a (graph) view?
Date: Wed, 25 Apr 2007 08:52:02 -0700
On 4/25/07, Arthur C. <email@hidden> wrote:
I have a window with two graph views in it. They are NSView subclasses of
which I don't have the source code.
I have implemented a screen capture of the view by taking the rectangle
forming the view using
NSRect graphRect = [self frame];
This gives the rectangle in the coordinates of the superview. Now I extend
the rectangle to be able to capture things just outside the graph view
(like
axis labels etc.). The screen capture can then be done by
NSData * myScreenCaptureData = [[self superview]
dataWithPDFInsideRect:
captureRect];
which is saved to file as PDF data.
Question is how to draw the rectangle showing what part is to be captured
(the captureRect).
It is too large to be drawn from within the graphView. But where should it
be done then? I have nothing but an NSWindow and the two graph views. So
should it be done from the NSWindow? But then I would have to subclass the
NSWindow(?)
To really answer your question it would be helpful to step back
describe what you are trying to do not how you are trying to do it.
I am trying to draw a rectangle just outside a graph view (which is an
NSView subclass, as I mentioned before).
What do you mean by screen capture in this context?
To take a graphics image of an area inside my application window and save it
to disk. So the users can store the graphics when something unusual shows
up.
But that's working OK; as an additional feature, I would like to mark the
area to be captured by a rectangle. I mentioned the screen capture just to
anticipate the question why anyone would want to draw a rectangle in his app
window...
- Arthur C.
_________________________________________________________________
Talk with your online friends with Messenger
http://www.join.msn.com/messenger/overview
_______________________________________________
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