Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGContextRef for Desktop !



Am 28.05.2008 um 14:50 schrieb Dan Ribe:
Is there anyway to get the CGContextRef corresponding to the main screen (Desktop) on Mac. I want to draw some images (CGImageRef) directly to the screen. I have tried below code but it is not working as contextRef is always coming as NULL. Please let me know if this can be done.

Nope. You'll have to create a window and draw into that. If it's just for debugging, you can probably use HIWindowFlush to cause an immediate redraw, and save yourself the event loop. Alternately, you could consider just drawing into a CGBitmapContext and then exporting that to a file for viewing in Preview or so.


Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >CGContextRef for Desktop ! (From: "Dan Ribe" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.