• 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
Re: NSImage origin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage origin


  • Subject: Re: NSImage origin
  • From: Don Willems <email@hidden>
  • Date: Thu, 23 Sep 2004 09:17:19 +0200

Thanks,

Off the top of my head, try adding:    

NSPoint myOrigin  = [self bounds].origin;
[[[NSAffineTransform transform]  translateXBy: - myOrigin.x yBy: -myOrigin.y]  concat];

Yes that worked ... almost! But I got signal 11 (SIGSEGV) errors.

So I changed my code to:

image = [[[NSImage alloc] initWithSize:cropped.size] autorelease];
[image lockFocus];
NSPoint myOrigin = cropped.origin;
NSAffineTransform *translate = [NSAffineTransform transform];
[translate translateXBy: -myOrigin.x yBy: -myOrigin.y];
[translate set];
[self drawViewRect:cropped];
[image unlockFocus];


and it works!

Again, thanks,
Don

_______________________________________________
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


  • Follow-Ups:
    • Re: NSImage origin
      • From: "R. Scott Thompson" <email@hidden>
References: 
 >NSImage origin (From: Don Willems <email@hidden>)
 >Re: NSImage origin (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Downloading files via HTTP with 304 support?
  • Next by Date: Moving objects with the mouse
  • Previous by thread: Re: NSImage origin
  • Next by thread: Re: NSImage origin
  • Index(es):
    • Date
    • Thread