• 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
Drawing 2D / NSQuickDrawView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing 2D / NSQuickDrawView


  • Subject: Drawing 2D / NSQuickDrawView
  • From: Stefan Robl <email@hidden>
  • Date: Sat, 26 Jan 2002 13:26:35 +0100

Hello everyone,

I'm trying to draw 2D-graphics using Cocoa. Unfortunately, there only seems to exist Quartz drawing functions which seems to be rather slow when it comes to several thousands of lines.
I want to display a large field of vectors (short lines) and if I use Quartz, it unusable slow (refreshing period: about 0.8 seconds/frame)...
As I don't need antialiased lines and graphics for this sort of operation, I searched for the direct way of drawing lines.

The only possibility I found was by using a NSQuickDrawView and using Carbon's QuickDraw drawing functions.

But I had no luck in getting it work... :-/

My test code looked like the following:

--- snip ---

- (IBAction)drawSomething:(id)sender
{
GrafPtr gp;

[quickDrawView lockFocus];

gp=[quickDrawView qdPort];

NSLog(@"Port address is: x", gp);

SetPort(gp);

PenSize(2,8);

MoveTo(0,0);
LineTo(200,200);

[quickDrawView unlockFocus];

[quickDrawView display];
}

--- snap ---


drawSomething is called on button press, nothing happens...

Does someone know a way how to solve my problem?
Or is there a better way to draw fast gfx?

Many thanks in advance!

Regards,

Stefan
--
More infos about ArtecScan, the QBox, FMdriver, PPCjpeg,
CGXBlanker, DPMSManager, AVL, ExifRenamer and my other projects?
Just visit my homepage: http://www.qdev.de


  • Prev by Date: Re: Localized questions
  • Next by Date: Re: How viable is Cocoa development?
  • Previous by thread: Re: Calling you...
  • Next by thread: How do I make NSData from cabron-Handle
  • Index(es):
    • Date
    • Thread