Is it possible to programatically set the display to a specific orientation?
I'm converting middleware code that on some platforms like Android use functions (like Activity::setRequestedOrientation()) that lets the developer change the display's orientation at any time in the application. Is it possible to do the same in Metro? Or do I only have access to the display through orientation change events?
My application is a fullscreen Direct X app.
Thanks!
You need to set the autorotation preferences, I believe:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.display.displayproperties.autorotationpreferences.aspx
These will allow you to set your current orientation; However, if you've got more than one set, then it will clearly pick that which it believes the device is currently set in.
Be aware that your app could be running on a device which doesn't support rotation -- e.g. desktop.
Related
What I have
OK, I have an App with multi Theme feature.. every time the user will chose his favorite theme... the BKG color will be stored in the userDefault
What I want
I want to pass this chosed color immediately to the launchScreen ((before the user close the App)) in order to be loaded in the next App launch.
I know that the launch screen is static and can't be changed in any way at runtime.
I know that the launch screen is shown before your app is actually running.
Also I know that we cannot add or link code to the launchScreen file because it will give the below error:
🌟BUT!!🌟
My idea is to change the launchScreen given color in the Assets.xcassets colors set by doing some trick by changing the actual color of the ((Assets color file)) programmatically!
Hope you got the trick ✅... I need your help on👇🏻👇🏻
How to change the color value in assists programmatically not manually (without changing its name).
The question is:
Will this method work or not?
How to change the color value in assists programmatically not manually (without changing its name).
An asset catalog, like all aspects of an app bundle and its contents, cannot be changed programmatically by the app.
This is for two reasons:
There is no programming API for doing it.
If it were somehow done, it would constitute a security violation (the app would no longer match its own checksum) and the app would refuse to launch.
The only way to run the app with a different asset catalog would be for the user to download and install a different version of the app, which has a different asset catalog.
I am using AFrame 1.2.0 to develop a VR application and I am struggling with an issue for several days.
My goal is to allow the user to see a specific view that is set programmatically and that is absolutely unrelated to the current device orientation. In other words, I should:
stop the user see the world based on its device orientation;
force the user to see a specific point (which I set programmatically);
These steps basically mean I should be able to:
disable the user-device rotation (UNRESOLVED for VR-Mode )
set the view to a specific position with a "refresh" rate (DONE)
As I wrote, the issue is related to the first point: disabling the user-device orientation and it only affects the VR mode. Indeed, everything works properly when the view is NOT in VR-Mode, but when entering in VR-Mode I can't do it anymore.
I tried managing these framework/library/APIs:
AFrame, look-controls: I know it is possible to disable look-controls with some properties (e.g. enabled, magicWindowTrackingEnabled, magicWindowControls): it works, but only when the view is NOT in VR-Mode; (note that hmdEnabled is no more in AFRAME from 0.8v because, as far as I understood, the introduction of WebXR does not allow to manage device directly from AFrame);
THREE.DeviceOrientationControls: I know that under the hood the look-controls component uses this THREE-element, so I debugged it and tried to manage it directly (e.g. calling disconnect, dispose, enabled=false): again, it works but only when the view is NOT in VR-Mode;
WebXR: at the lowest lever, WebXR is the last API used. I debugged it and I try to manage the WebXR session, but everything is in Read-Only mode and it seems there is no function to activate/deactivate device sensors.
So, here the question: how to disable the device orientation in VR mode with AFrame/THREE/WebXR or whatever?
Thank you all.
I have the task of testing a web application where it is given that this app should fit a screen with the resolution of 1280*1024.
My work monitor is, however, a 20 inch screen with resolution 1680*1050.
Will resizing the Firefox window to 1280*1024 meet the test criteria or should I always change the resolution of my monitor? (Obviously, the second option is not preferred).
And also: Is there a Firefox plugin which will help me to set the window size appropriately?
Sometimes asking the question out loud helps to realise what you really want :)
There is Firefox addon called More Display Resolutions which helps to show the page in given resolution, even in 1280*1024
After you install it, just go to Tools -> Web Developer- > Responsive Design View and here you can turn on the preffered resolution:
Ok, the above died. What now?
Since time of writing this answer I changed jobs and do not have to test specific resolutions. But I did quick google search and this site seems to be working: http://quirktools.com/screenfly/
Responsive Design Mode is a stock part of Firefox which is available from the Menu Bar: Tools -> Web Developer -> Responsive Design View in all Firefox versions (keyboard shortcut: Ctrl + Shift + M, (or Cmd + Opt + M on OS X)). No extension is needed to access this mode.
Within Responsive Design Mode, you can set the exact display area used for the webpage. There are several preset dimensions. Alternately, custom display dimensions can be used by either directly typing the dimensions in, or dragging the display to the size desired. What is being set is the pixel dimensions used for the area containing the display of the webpage.
These dimensions are not the same as setting the pixel dimensions used for the entire screen, which would include the Firefox user interface. If you set it to the dimensions of a specific physical display size it is the same as would be displayed using Full Screen mode (on desktop versions, keyboard shortcut F11). If you want to see what your page will look like including the Firefox user interface, you will need to determine how many pixels the user interface consumes at the screen resolution you are interested in and on the platform you are intending to use (e.g. desktop, Android, iOS). You will then need to use a custom display size. Note that the amount of room used for the Firefox user interface will depend on many factors which include—in addition to the OS and resolution of the physical display—any theme the user has installed, which toolbars the user has chosen to display, and, potentially, which add-ons the user has installed.
This is what Responsive Design Mode looks like:
I'm working on an app where I need to change the brightness. However, I want the user to be aware of the relative brightness by seeing the built in brightness slider they're used to. Also- this designed to run only on laptops or tablets so the displays should support programmatic brightness.
*Note: This image was stolen from this post.
I was hoping it would automatically show up when I changed the brightness programmatically but no luck there. I tried doing so with WmiSetBrightness() and with PowerWriteACValueIndex() but neither of them showed the slider.
TL;DR I want to programmatically invoke the slider to show the user what the current brightness level is. Any ideas?
To my knowledge, the windows, labels, ... etc. are automatically retina-fied when they run on the new MacBooks with Retina Displays. That's the case with most of the apps I have (third party apps I didn't develop). However...
There is this specific app (Yummy ftp), that just looks miserable on the retina. Every single "thing" within the window is non-retina-fied. Even the window's toolbar.
In a counter example, many other apps just got automatically retina-fied (except raster images, CoreGraphics/CoreAnimation stuff, ...etc).
Showcase:
I did not scale these images. I am just screen capturing, cropping, and uploading.
As a cocoa developer, I would like to know the cause of such misbehavior, and how to avoid it.
https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html, make sure the guide have be read. "An App’s High-Resolution Capability Is Available in the Info Window
Users can find out whether an app is running in low resolution by opening its Info window and looking at the “Open in Low Resolution” checkbox, as shown in Figure 1-7. Apps that aren’t Cocoa apps have this checkbox selected and unavailable (dimmed). Most Cocoa apps have this checkbox available, but not selected. A user can choose to run a Cocoa app in magnified mode if the app has usability issues related to high resolution.
Figure 1-7 The resolution option in the app’s Info window![enter image description here]
Some Cocoa apps that are not fully optimized for high resolution might have the checkbox selected and available by default. These apps will run in magnified mode unless the user overrides the default setting. Users might want to override the default if the issues related to high resolution are tolerable.
If the “Open in Low Resolution” checkbox is selected by default for your app—whether the checkbox is available (dimmed) or not—you can change the default by:
Fixing all bugs related to high resolution
Setting the NSHighResolutionCapable attribute to YES, in the Info.plist for the app, as shown in Figure 1-8.
Figure 1-8 The key that indicates an app is ready for high resolution![enter image description here]
When users update to the revised version of your app, they will be able to enjoy the high-resolution version.
If your app is optimized for high resolution, you can request that the “Open in Low Resolution” checkbox is not displayed by adding the NSHighResolutionMagnifyAllowed key to the Info.plist for your app. Then, set the key’s value to NO (Boolean value). A value of YES (the default) means that checkbox should be shown as usual."
I found an open-source application that had the exact same problems as Yummy FTP:
Audacity
After exploring the project, I realized that the application was developed in C++ for cross-platform capability, that's why it didn't support the MacBook with retina display automatically. Figuring out if it is possible or not to support the retina display is outside the scope of this question.