Display Capture Problem
Display Capture Problem
- Subject: Display Capture Problem
- From: Seth Willits <email@hidden>
- Date: Sun, 3 Aug 2003 15:57:37 -0700
Ok so I worked out all of the code (simple version posted below) and
got it to display the desired resolution and switch back appropriately
but I noticed it moved my icons. Then I remembered someone told me to
capture the display to prevent this so I did that, but when the
resolution switches the screen is black and then when I switch back,
the icons are still moved.
I noticed the CGDisplayCapture() function says this: "To prevent
updates by direct-to-screen programs (such as Classic), Quartz draws a
shield window that fills the entire screen of a captured display. Note
that the graphics context associated with a shield window is not a
full-featured drawing context."
This sounds like I have to send makeKeyAndOrderFront to my window but
that didn't work. Any help would be appreciated.
- (IBAction)switchRes:(id)sender
{
boolean_t exactMatch;
CFDictionaryRef mode;
CGDisplayErr err;
originalMode = CGDisplayCurrentMode( displayID );
if ( originalMode == NULL )
return;
mode = CGDisplayBestModeForParameters(displayID,
[depthField intValue],
[widthField intValue],
[heightField intValue],
&exactMatch);
err = CGDisplaySwitchToMode(displayID, mode);
if ( err != CGDisplayNoErr )
return;
err = CGDisplayCapture(displayID);
if ( err != CGDisplayNoErr )
return;
didSwitchModes = YES;
}
Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software -
http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine -
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central -
http://www.freaksw.com/rbgames
"Few are those who see with their own eyes and feel with their own
hearts."
-- Albert Einstein
------------------------------------------------------------------------
---
_______________________________________________
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.