Limit media player fullscreen to the bounds of my application - c#

So a lot, if not most of all Media Players have a "fullscreen" mode. My application has a WebBrowser control and also an embedded Windows Media Player control. Now the problem here is that the fullscreen mode is literal. It actually covers my whole screen.
Is it possible to somehow modify the behavior of my application so that all "fullscreen" modes only stretches to the bounds of my application. Basically only "fullsceens" inside my application?
Any hints or suggestions are welcome!
Only idea that I could come up with it somehow fool windows thinking that my application is a monitor. But maybe that's taking it too far?

No way, sir.
"Full screen" is "full screen" and it is managed by OS to cover all the screen.
If you need to adapt the video size based on parameter you can't work on full screen.

Related

How to disable full screen exclusive mode?

I have a computer with Windows 7. I have got 3D simulator installed. This simulator provides window. I want to place transparent window on top of simulator's window (with my extra drawing).
Problem is that simulator's window switches to "full screen exclusive mode" on mouse click. That makes hardware work faster. But that hides the rest of windows (even topmost) including mine transparent window.
Is the a way to disable full screen mode?
This is very interesting post (and it is related to my question):
Detect if user has any application running in fullscreen
Here is a little tip from me: if you are using Presagis Vega Prime then you can switch full screen exclusive mode on and off using acf-file (Full Screen checkbox at Pipeline\Window).
In my case I switched Full Screen off and configured Coordinates so result 3D simulator's window still covers full screen ("fake" Full Screen Mode).
After that there are no problems with my transparent window.

Interop.quartztypelib odd behavior

I'm being annoyed by an odd behavior of Interop.quartztypelib in making media player with c#. With the help this link
http://www.codeproject.com/Articles/2632/DirectShow-MediaPlayer-in-C?msg=4853463#xx4853463xx
I created my own video player with Interop.quartztypelib. There's an important function for me to implement is that my application shall be able to capture the video image, just like you click "ALT" + "Printscreen" to make a screenshot of an active window in windows. But surprisingly I found that in the image captured by my application (I use
Graphics.CopyFromScreen
in my code), there's no video image on the video screen! I got the image of my form (the video player) but not the image of the video being played! And clicking "ALT" + "Printscreen" just gives me the same result!
I'm wondering if this Interop.quartztypelib doesn't support image capture. Anybody knows if there's a way to do settings to enable this? Thanks.
Printscreen doesn't do that
You need to implement some way of switching out of overlay, or some other way of getting a still. There is some trick with hardware acceleration, buts its not really applicable to you as the application dev. You're probably have to get antiquated with rendering api's.
For OpenGL api I think it would be glReadPixels.
For directX here's a SO question. I'm going to guess its directX in your case.

Poor StackPanel performance with WPF

I have an application which runs fullscreen on a high resolution display (1920x1080).
About 25% of the screen is a StackPanel that scrolls images across the screen.
(the X position is animated with double animation)
The scroll is very laggy and jumpy, and with visible tearing.
This is running on a brand new high-end gaming laptop, running Win7 64bit.
I don't understand why the performance is so poor. Am I doing something wrong? Does this kind of animation run on the CPU or GPU? Is there a smarter way to scroll images across the screen?
WPF can be hardware-accelerated, but only on newer video card drivers. Some of the onboard, out of box drivers, will default back to software rendering, which can feel really slow and clunky. As for the tearing, that's a normal video card setting, called V-Sync. I would try updating the video card drivers to a proprietary driver (nVidia, AMD, etc.), and enabling vertical sync on the card.
You can check to see if it falls into software, or hardware rendering using the methods explained here.
If that doesn't resolve the issue, the only other possibility I can think of is your animation/rendering is not synced to the GUI.
See this msdn article for more details.
A trick that I've seen that can get around this issue is to place a 3D object on your page, view it side on and rotate it e.g. for 4 images have a cube with an image set to each side.
Yes the rotation still requires GPU and processor time but it is taken care of internally by the WPF animation and so doesn't require interaction with code behind once set rolling.

c# resize window over display resolution

I am total newbie in .Net programming so be patient, please ;-).
I have problem with resizing window. I want to resize from my app other app's window and take screenshot of it. I do resizing based on this example: http://blogs.geekdojo.net/richard/archive/2003/09/24/181.aspx. But I have a problem. I work on a laptop with 1024x640 pixels screen resolution but I want to resize my window to 1200x1600 px. I can't do that couse display limitations. Is there any tricky solution to resize window for this resolution and take a screenshot of whole window? I've alos tried Sdesk program witch is suggested here: Create Window larger than desktop (display resolution). Any help?
I would suggest you find a way to set a virtual resolution larger than your physical resolution (basically what sDesk does), and then let your application run normally on that large desktop. Depending on your video card, you might be able to configure the virtual resolution directly in the video driver, without using any additional utility.
No it is not possible. In fact you can't resize in any way the windows greater then the display size.
Just try it by position a window in normal mode (not minimized or maximized) somewhere on the left. Grab the right border of it and increase the width till the end of your screen. Now move the window, by grabbing the title bar, some more to the left. Repeat this procedure several times. At some point you're not able to get the window any wider anymore. If you now try to move the window till the right border hits the right side of your desktop, you'll see that the left border is direct at the left desktop side.

Windows form rotation

When you create a form in .Net it appears as a dialog box in a portrait layout.
No one normally likes to read sideways, or upside down, but I have a very valid reason to rotate the form.
Anyone knows how to do it on Windows Vista with C#?
Does it have to be in WinForms? This is very easy to do in WPF, using rotation transforms. Unfortunately, the WindowsFormsHost integration with WPF does not allow rotation transforms.
EDIT
I understand, now, that the form in question is out of the control of the poster. Writing the control in WPF won't fix the problem.
This would be a bit of extra work, but if you mainly just need the contents of the form to be rotated (and not the entire window including title bar, window controls etc., which I've never seen before), you could instead make an entirely owner-drawn usercontrol that was rotated 90 degrees, and drop it on an ordinary form. You wouldn't even have to adjust your drawing of everything, since you could do a RotateTransform on your Graphics object and then draw everything normally.
Or if you need the entire form rotated, you could make the form borderless and then do basically the same thing, drawing the title bar and windows controls yourself also.
Update: here's a link to an MSDN article that shows how to rotate the entire screen in C#:
http://msdn.microsoft.com/en-us/library/ms812499.aspx
This is for regular Windows (not Windows Mobile), so it should work for your porpoises, although it will rotate all of Windows and not just your application's form. Depending on how fast this works and your overall needs, you could rotate the screen 90 degrees when your application gets the focus, and then rotate it back to normal when your app loses focus.
Update 2: I just reread your question and comments. You're talking about rotating the window of a separate application in a separate process, so WPF will definitely not help you here. The MSDN link might be what you need. In your application, you would rotate the screen 90 degrees, then start the other application in a separate process. This would work best if you could force the separate application's window to be maximized, which you can do by P/Invoking the FindWindow and SendMessage APIs (you could also make the window always on top, which would put your computer into a sort of kiosk mode for this application). There's a version of the Process code that basically makes starting another application a blocking call, which means your app will wait for the shelled application to close before resuming. Once the app closes, you can put the screen back to its normal orientation.

Categories