• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Quartz 2D instead of QuickDraw

New Here ,
May 20, 2007 May 20, 2007

Copy link to clipboard

Copied

Hi,<br /><br />I'm writing some custom UIs for an effect plugin on OS X and would like to use Quartz 2D rather than QuickDraw. I noticed that the SDK samples are still using QuickDraw -- is this for any technical reason or just due to their legacy?<br /><br />I tried the following test but couldn't get it to paint anything:<br /><br />-----------------<br />void *dp = (*(event_extra->contextH))->cgrafptr;<br />CGrafPtr port = reinterpret_cast<CGrafPtr>(dp);<br />CGContextRef myContext;<br /><br />OSStatus status = QDBeginCGContext(port, &myContext);<br />if (status == noErr)<br />{<br /> CGContextSetRGBFillColor(myContext, 0, 0, 1, .5);<br /> CGContextFillRect(myContext, CGRectMake(onscreenRect.left, onscreenRect.bottom, 100, 100));<br /> CGContextFlush(myContext);<br /> <br /> QDEndCGContext(port, &myContext);<br />}<br />-----------------<br /><br />So for now am using QuickDraw.<br /><br />Thanks,<br />Neil
TOPICS
SDK

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 21, 2007 May 21, 2007

Copy link to clipboard

Copied

Use Quartz; QuickDraw is an antique (that we should really replace in future SDK releases).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 19, 2009 Jan 19, 2009

Copy link to clipboard

Copied

LATEST
Hi

Where is a way how to draw in effect's panel with help of Quartz functions?

All that I need it is the way how to obtain CGContextRef in Draw Event. QDBeginCGContext doesnt work because probably it is nested call.

In Windows I can just get HDC value of custom UI element and freely draw here and I would like to have similar flexibility on Mac also.

Is it possible? If there is not a direct way how to get CGContextRef then maybe I can obtain EventRef for call GetEventParameter similar as in "Panelator" sample?

Many thanks

Maxim Chernousov

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines