• 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
Capturing a view's drawings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Capturing a view's drawings?


  • Subject: Capturing a view's drawings?
  • From: Uli Kusterer <email@hidden>
  • Date: Sat, 1 Nov 2003 15:52:25 +0100

Hi folks,

I'm attempting to record an NSTextView's drawings into an NSImage, but the drawing is always a little below the text view's drawing. Always something in the range of two or three pixels. Anybody have a clue how this works? I tried:

NSAffineTransform* at;

[finalImage lockFocus];
at = [NSAffineTransform transform];
[at translateXBy: [textbox frame].origin.x
yBy: [textbox frame].origin.y];
[at concat];
[textbox drawRect: [textbox bounds]];
[finalImage unlockFocus];

Where finalImage (an NSImage*) is the size of the view that contains textbox. And the containing view fills the entire window. And I'm not calling this from drawRect:.

Any clues appreciated.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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: Variables: Why one way and not another?
  • Next by Date: Re: Slower with Cocoa subclass
  • Previous by thread: Re: Variables: Why one way and not another?
  • Next by thread: Re: Slower with Cocoa subclass
  • Index(es):
    • Date
    • Thread