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

Re: NSImage and flipping


  • Subject: Re: NSImage and flipping
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Sun, 15 Feb 2004 21:45:58 -0800

Hello...

An addendum to my previous message:

In addition to using dataWithPDFInsideRect: as I mentioned before, you also could possibly use the NSString instance method drawInRect:withAttributes: or the NSAttributedString instance method drawInRect:, both of which are capable of drawing text correctly regardless of the (un)flipped state of the view (or image) you are drawing into.

Of course since you are using custom text drawing code, it's possible that what you are trying to do isn't simple enough to use the string drawing methods, but maybe it would be good enough for the dragged image...

Louis


2004-02-14 kl. 21.02 skrev Louis C. Sacha:

Hello...

For an NSImage, the "flipped" state refers to the destination view where the image will be composited, not the source view. So, all you probably have to do is not call setFlipped:YES...

Well that's just what I thaught. Unfortunately it doesn't work. In an ordinary NSView toggeling the flipped state affects the order of multiline text rendering. If its not flipped the text comes out like this:

out like this
the text comes

Setting it to flipped makes Cocoas text rendering put the lines in the correct order. When using the same code to draw text in an NSImage that is not flipped. The text comes out the same way. That is:

out like this
the text comes

This is clearly not what I want. But if I set the the flipped state to true in an NSImage I don't get the same result as in an NSView. Instead the finished graphic (the pixels) comes out upside down. This is not what I want either.

Thank you anyway. If you have any ideas please let me know.

Bjvrn
_______________________________________________
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: Better way to deal with NSFontPanel in a preference pane
  • Next by Date: Re: Better way to deal with NSFontPanel in a preference pane
  • Previous by thread: Re: NSImage and flipping
  • Next by thread: Re: NSImage and flipping
  • Index(es):
    • Date
    • Thread