DirectDraw application goes black after screen orientation change - windows

I have a directdraw application (in c) that becomes black in color once the user rotates the screen using a button on the application. The button uses enumdisplaysettings to do this. I have tested this on both Nvidia and ATI, the problem persists.
Is there a way to make a directdraw application "displaysettings-proof"? Can I add some code to get back the display once the screen is rotated?

You can use IDirectDraw::RestoreDisplayMode to reset the display mode to whatever it was before IDirectDraw::SetDisplayMode was called. I'm not quite sure if this is what you want however.

Related

How to resize Game Window with the Windows API?

I am developing a 2D video game and trying to implement a good fullscreen extension to the game maker, Clickteam Fusion.
I've tried using SetWindowPos and I can get the window to look the correct size, but then when using the Steam Overlay the overlay is showing offscreen because it is using the initial window size I set in the game maker.
it is clear that the SetWindowPos is just shrinking the window to fit the aspect ratio of my monitor, but the game still is acting like the game is still the initial window size so content gets loaded that is actually outside the display, including Steam Overlay notifications and such.
Is there a better Windows API command I can use to actually adjust a game window?

Windows 10 tablet with duplicated screen forced in portrait mode

Better than a long description, I made some schemas :)
The 2 native use cases show the classical behaviours when I rotate my tablet.
Native Landscape mode use case
Native Portrait mode use case
Now, I would like to be able to rotate virtualy my tablet and see on the 2nd screen in Portrait mode.
In other words, the tablet remains in landscape with the view rotated 90° and the 2nd screen shows view portrait.
Wished behaviour use case
But I encountered 2 issues:
1/ The 2nd screen remained in landscape mode with 90° rotation when the "lock rotation" feature is enabled.
Behaviour issue when lock rotation enabled
2/ The tablet toggled into lanscape because of autorotation and the 2nd screen stayed in portrait mode but the view is the landscape one.
Behaviour issue when lock rotation disabled
So to do that, I found Display.exe to rotate my view and it's a good start.
But it seems that the software is not designed to handle the wished use case.
Is there some extra configuration on Windows 10 to change in order to force duplicated screen to be in portrait mode?
Other ideas to reach my goal are welcome!
Thanks all,
Kelson

Land scape issue when screen orientation off and on windows phone

Landscape mode handle when auto screen orientation is ON and easily turn to portrait. But Auto Screen Orientation is Off then forcefully change supported orientation which effect on if Auto Screen Orientation is ON. Pls tell me these things in WP
How check auto screen orientation of setting ON or Off?
Another way to change orientation of screen contents?
To specify that your app supports portrait and landscape, you must set the SupportedOrientations property to PortraitOrLandscape either in the XAML or in the code.
Add this piece of code in your XAML within the <phone:PhoneApplicationPage>
SupportedOrientations="PortraitOrLandscape"
Take a look over here
Hope it helps!
Read this quick start tutorial on how to gracefully handel orientation change in windows phone 8
Screen orientation for Windows Phone 8
In short, if you need to support both orientations than first you need to change your SupportedOrientation in you page xaml SupportedOrientations="PortraitOrLandscape"
Then handle orientation Changed Event in the code for UI related changes(as explained in above artical)
You can use following page property on page load to check the current orientation of the screen when it is loaded.
this.SupportedOrientations
Hope this helps

Zoom (magnifying glass) effect in OS X

I'm trying to create Magnifying Glass App very similar to build in in OS X (Mountain Lion).
I'm wondering how can I acheive this effect, using which frameworks?
What do you think, could it be a custom cursor? The image displayed in this rectange is just zoomed portion of backgound-spapped screen? I think that kind of implementation can run sluggish, and it could be difficult to change cursor whole System not only in "zooming" application.
Or maby it is use some quartz functionality is not known for me :)
I found one thing tha is interesting about Apples implementation (build in OS X), when I enter in zoom-mode and do a ScreenShot using Ctrl+Cmd+4 and next Space the image captured is like that:
With out any content of screen only the border of zooming area. So it tells me that it is some kind of transparent window abowe the screen but it is not taking over the focus.
Have you got any idea how to do that ?

How to dim os x desktop using Cocoa/Core Animation

Is there a way to control the brightness of the OS X desktop programmatically using Cocoa or Core Animation?
Create a semi-transparent full-screen view behind your main window.
In case you were actually interested in doing a fade-out or fade-in of the whole screen, here is a link describing how to do that.
The linked document contains examples for how to fade all displays (or a single display) to black (you can change the color), capture the display (where you can display what you'd like), and then fade back. This uses CGAcquireDisplayFadeReservation() mentioned in the comment to my other answer.
Is this more like what you were looking for?

Resources