• 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
text view drawing upside down... HELP!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

text view drawing upside down... HELP!


  • Subject: text view drawing upside down... HELP!
  • From: Salánki Benjámin <email@hidden>
  • Date: Thu, 13 Feb 2003 17:45:30 +0100

Hi,

I wrote some code that should make an image from a text view, but
somehow the image starts drawing the text from the lower left corner,
so I get the whole text, but the first line is on the last line, the
second line before the last line and so on. This is totally beyond me.
can anyone please help me?

Thanks,

Ben

NSTextView* theTextView = [[NSTextView alloc] initWithFrame:[theButton
frame]];
[theTextView setString:[[NSPasteboard generalPasteboard]
stringForType:NSStringPboardType]];

NSImage* theImage = [[NSImage alloc] initWithSize:[theButton
frame].size];
[theImage lockFocus];
[theTextView drawRect:[theButton frame]];
[theImage unlockFocus];

[theButton setImage:theImage];
[theTextView release];
theTextView = nil;
[theImage release];
theImage = nil;
_______________________________________________
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.

  • Follow-Ups:
    • Re: text view drawing upside down... HELP!
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: [Newbie] NSOutlineView and icons
  • Next by Date: Re: scientific number formatter
  • Previous by thread: Can't open drawer
  • Next by thread: Re: text view drawing upside down... HELP!
  • Index(es):
    • Date
    • Thread