ScrollView thumbnail custom view
ScrollView thumbnail custom view
- Subject: ScrollView thumbnail custom view
- From: Tim Lucas <email@hidden>
- Date: Thu, 14 Oct 2004 18:10:59 +1000
I'm trying to create a custom view which, when connected to an
NSScrollView, will show a thumbnail overview of the scroll view's
document and a transparent overlay showing the current contentViewRect
(similar to Adobe Photoshop's 'Navigator' palette).
I'm having trouble grabbing the imageRep of the NSScrollView's
documentView.
The following grabs the imageRep of the entire window, instead of just
the documentView:
NSImageRep *imageData = nil;
// lock the focus for the next call
if([[scrollView documentView] lockFocusIfCanDraw])
{
// grab the imagerep from the view
imageData = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:[[scrollView contentView] documentRect]];
[[scrollView documentView] unlockFocus];
}
if(imageData)
{
[imageData drawInRect:rect];
}
If I change it from documentView to contentView it works as expected,
and shows the image of just the visible part of the scroll view.
Any pointers?
Cheers,
Tim
_______________________________________________
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