• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ScrollView thumbnail custom view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: how to add 'file format selection' popup menu in save panel
  • Next by Date: Re: Does anybody program in Java?!?!
  • Previous by thread: Re: NSAppleScript: buggy?
  • Next by thread: NSView that follows the tracking of a NSScrollView
  • Index(es):
    • Date
    • Thread