• 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
multible NSImages rotated in the same view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multible NSImages rotated in the same view


  • Subject: multible NSImages rotated in the same view
  • From: Brian Williams <email@hidden>
  • Date: Fri, 15 Feb 2002 08:21:15 -0800 (PST)

Hi all,

Sorry but I am feeling stupid today. Can't seem to get
a grip on the whole drawing cooridnate system. The
docs haven't helped and the list archives aren't
producing much for me.

Question:
How can I rotate a NSImage multiple times in the same
NSView? This code does not work:

- (void)drawRect:(NSRect)rect {
NSRect sourceRect NSMakeRect(0,0,[img
size].width,[img size].height);

[[NSColor blueColor] set];
NSRectFill([self bounds]);

[img drawAtPoint:[self bounds].origin
fromRect:sourceRect operation:NSCompositeSourceOver
fraction:0.5];
[self rotateByAngle:45];
[img drawAtPoint:[self bounds].origin
fromRect:sourceRect operation:NSCompositeSourceOver
fraction:0.5];
[self rotateByAngle:-45];
}

One other question:

why does making the sourceRect bigger make the image
small on the screen? I guess I really don't understand
the coordinate system

Thanks for reading this and for any help

Brian
Got something to say? Say it better with Yahoo! Video Mail
http://mail.yahoo.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Is there a formatter sample?
  • Next by Date: Getting behind NSBeep
  • Previous by thread: Re: file example
  • Next by thread: Re: multible NSImages rotated in the same view
  • Index(es):
    • Date
    • Thread