I am just starting to develop an windows app.I want to load different image when an application starts in landscape/portrait mode . There should be different image in splash screen on the basis of whether it starts in landscape mode , snapped mode or portrait mode.
Thanks in advance.
You could use an extended splash screen which is responsive to orientation changes:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868191.aspx
To maximize the benefit of the extended splash screen you should minimize the time the default splash screen is shown. There are some articles that tackle this topic:
http://msdn.microsoft.com/cs-cz/library/hh994639.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/hh994640.aspx
To add to what Fred writes, the initial splash screen displays until the app's code takes over, so the app doesn't have any run-time control over the initial splash screen. The app can provide different images for different resolutions, languages, contrast modes, etc. but not based on orientation. See How to name resources using qualifiers
Once the app is loaded and running then it can manage its own extended splash screen as Fred describes. The extended splash screen can be fully customised since the app is active and running code.
Related
I'm using the standard recommendation for creating a Window and having it display on a secondary monitor:
I use the following to get the screens available:
Screen[] availableScreens = Screen.AllScreens;
Extract the working area of the target screen (second screen in my case, not the primary screen):
secondaryScreenWorkingArea = availableScreens[1].WorkingArea;
When creating the window, set the location properties based on the working area (before calling Show()):
Left = secondaryScreenWorkingArea.Left;
Top = secondaryScreenWorkingArea.Top;
Width = secondaryScreenWorkingArea.Width;
Height = secondaryScreenWorkingArea.Height;
Some other things to note about the window:
It is a fullscreen window that is intended to span the entire second
display
It is not the main application window
It is hidden from the taskbar, it is intended to be supplemental to
the main application window
WindowState = WindowState.Maximized;
ShowInTaskbar="False"
WindowStyle = WindowStyle.None;
Running on Windows 10 Enterprise V 1809
Below is a rundown is different configurations that I've tested, and only one of them is not behaving correctly:
When I run this on a workstation setup with two 1920x1080 displays, 100% display scaling, it works as expected.
When I run this on a workstation setup with two 1920x1080 displays, 150% display scaling, it works as expected.
When I run this on a workstation setup with a 1920x1080 display and a secondary USB display (800x480) connected, 100% display scaling, it works
When I run this on a workstation setup with a 1920x1080 display and a secondary USB display (800x480) connected, 150% display scaling, it works
When I run this on a Microsoft Surface Go with the main surface display (1800x1200) and a secondary USB display (800x480) connected to the surface dock, 100% display scaling, it works
When I run this on a Microsoft Surface Go with the main surface display (1800x1200) and a secondary USB display (800x480) connected to the surface dock, 150% display scaling, it DOES NOT work. Instead, once Window.Show() is called, this is triggering the window to relocate to the primary display (The surface go screen). I noticed this because I am receiving a LocationChanged event for the window during my call to Window.Show() and see the Width and Height properties have updated to the sizing of the Surface Go display (1800x1200). But, curiously, the Top and Left properties are NOT updated even though the window has moved.
As you can see from the cases above, it seems to be an issue with Display scaling + the Surface Go. On my workstation, I forced the same resolution as the Surface go (1800x1200) and set display scaling to 150%, but could not replicate the issue from the Surface Go
Furthermore, I performed some testing with another USB display with a slightly higher resolution (1024x600) and have noticed that the same issue occurs, only on the Surface Go, but this time it required me pushing the display scaling to 200% before the issue began to occur in that configuration.
Several things I've tried, but none produced any solutions to this issue:
Tried various configurations of dpiAware and dpiAwareness. These changed the scaling of the coordinates I received when grabbing the AvailableScreens, but using scaled/unscaled coordinates had not affect on this issue
Restarting the Surface Go after changing the display scaling option (per the "Some apps won't respond to scaling changes until you sign of" message displayed in the Display Settings
Tried setting WindowState = WindowState.Maximized both before and after the Loaded event and both yielded the same result.
Any help or other ideas for things to try would be appreciated, not sure if this is a WPF, Windows 10 or a Microsoft Surface Go issue.
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.
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.
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.
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.