Draw a screen using quartz

I am trying to figure out how best to draw the top of all the other elements on the OS X screen. I do not want to interfere with the user's ability to interact with their applications, but I want to “annotate” them. I want to be able to compose up to 20 different annotations. At the top of this screenshot from Gizmodo, it’s nice to show what I want to do. http://gizmodo.com/assets/resources/2006/07/04%20Safari.jpg (sorry, I'm too new to post it as an image)

I think I need to answer:

  • Should I create one window for each drawing and draw on it? If so, how do I minimize service data?
  • Which window or other context should I use, given that I do not want any window decoration?

I don’t think I need the overhead of creating 20 windows, but I also don’t know that I want to create a full-screen invisible window containing my context (I assume that NSView subclasses), because I fear that will a) cause problems interacting with what is lower, and b) violate the intricacies of only redrawing if necessary (my actual drawing will most likely cover only 10% of the screen)

I have not worked with Quartz2d before, so I just can’t figure out how to get the “right” context that can be extracted from the documentation. Any help would be appreciated.

Thanks,

Who

+1
source share
1 answer

You can only draw a window. You can make a transparent, borderless window, but it should be on the front panel.

You can set the level to something like NSPopUpMenuWindowLevel to make it draw on other windows (this will be very unpleasant for users), but clicking on it will:

a) activate and bring your application to the forefront

b) Prevent the application from receiving mouse events

Is this what you want?

+1
source

All Articles