• 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
Leopard broke NSView's cacheDisplayInRect:toBitmapImageRep:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Leopard broke NSView's cacheDisplayInRect:toBitmapImageRep:


  • Subject: Leopard broke NSView's cacheDisplayInRect:toBitmapImageRep:
  • From: Gerd Knops <email@hidden>
  • Date: Wed, 7 Nov 2007 17:06:49 -0600

I use the code below to produce a drag image. The view in question is scaled. The code works fine under Tiger, but under Leopard the view representation only fills a tiny area in the bottom left corner of the drag image.

Any ideas?

Thanks

Gerd


NSSize mySize=[self bounds].size;
NSSize imgSize =NSMakeSize(mySize.width*dragScaleFactor,mySize.height*dragScaleFactor);

NSBitmapImageRep *bir=[self bitmapImageRepForCachingDisplayInRect: [self bounds]];
[self cacheDisplayInRect:[self bounds] toBitmapImageRep:bir];

DLog(@"mySize : %@",NSStringFromSize(mySize));
DLog(@"imgSize : %@",NSStringFromSize(imgSize));
DLog(@"bir size : %@",NSStringFromSize([bir size]));

NSImage *dragImage=[[NSImage alloc]initWithSize:imgSize];
[dragImage addRepresentation:bir];

DLog(@"dragImage size: %@",NSStringFromSize([dragImage size]));


Output under Tiger:

PageView.m:398: mySize        : {3728, 5856}
PageView.m:399: imgSize       : {96, 150.798}
PageView.m:400: bir size      : {96, 151}
PageView.m:405: dragImage size: {96, 150.798}

Leopard (different scale, but note the different size for bir):

PageView.m:398: mySize        : {3728, 5856}
PageView.m:399: imgSize       : {288, 452.395}
PageView.m:400: bir size      : {3728, 5856}
PageView.m:405: dragImage size: {288, 452.395}

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Prev by Date: Re: multi coloured string
  • Next by Date: Re: NSLayoutManager and avoiding widows and orphans
  • Previous by thread: Re: multi coloured string
  • Next by thread: Re: Leopard broke NSView's cacheDisplayInRect:toBitmapImageRep:
  • Index(es):
    • Date
    • Thread