• 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
initWithFocusedViewRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

initWithFocusedViewRect


  • Subject: initWithFocusedViewRect
  • From: Lorenzo <email@hidden>
  • Date: Mon, 11 Jul 2005 18:50:42 +0200

Hi
the method initWithFocusedViewRect:croppedRect
returns a NSImageRep with different size than the croppedRect size.
Why?

I do:
    NSRect  croppedRect = NSMakeRect( 0.0, 0.0, 1024, 128);
    [textView lockFocus];
        bitmap = [[NSBitmapImageRep alloc]
                    initWithFocusedViewRect:croppedRect];
        NSLog(@"size: %d x %d",
               (int)[bitmap size].width, (int)[bitmap size].height);
        NSLog(@"Wide x High: %d x %d",
                (int)[bitmap pixelsWide], (int)[bitmap pixelsHigh]);
    [textView unlockFocus];


I get [bitmap size].height = 121 and not 128;
Also I get pixelsHigh = 121 and not 128;
Why?

If I set [bitmap setSize:croppedSize];
I get the proper size, but the image seems to be distorted.
Is anyone understanding what's going on with my image?



Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
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: SOAP Handler question
  • Next by Date: Re: Inserting Special Characters into a String
  • Previous by thread: NSSlider and integer values
  • Next by thread: Tooltips on individual segmented cells
  • Index(es):
    • Date
    • Thread