UWP, how to handle images and scaling? - xamarin.forms

We have a Xamarin Forms project which shall run on Android, iOS and UWP. On Android you have a number of different images in different folder to support a vast number of different screens (and PPIs) on iOS you have a similar system (#2x, #3x etc.). I can't for the life of me find how to achive something similar for UWP. When I run the project on a Windows tablet with a recommended scaling of 150 % or 200 % all the images are also scaled up, which results in a blurry image. I can't find any thing on how to handle images in an UWP app, even for a "native" (not using Xamarin) UWP app.

Scaling images in UWP native is done by supplying different scaled versions in the Assets folder.
The file naming pattern is like so : ****.scale-100.png or ****.scale-200.png
The actual file name to use in your app is still ****.png but the system will auto detect the needed scaled version and use that.
For reference the doc on this is here https://learn.microsoft.com/en-us/windows/uwp/app-resources/images-tailored-for-scale-theme-contrast and here https://learn.microsoft.com/en-us/windows/uwp/app-resources/tailor-resources-lang-scale-contrast
Recommended scale factors are 100, 200 and 400.

Related

Layout elements looks blurry on 4K screen Android TV

I am developing an app for Android TV it is a screensaver app and I just loading a URL in WebView I have used DayDream Service for this purpose everything is fine, I just want to know that how can I make my layout to support 4K resolution, because when I load [http://howbigismybrowser.com/] it shows 960*500 every time no what configuration I am using. I have seen google official doc on the link
[https://developer.android.com/training/multiscreen/screensizes]
also, I have seen this link and implemented the same link
I have tried by making folder configurations like
layout-sw320dp
layout-sw600dp
layout-sw720dp
[Which resource qualifier should I use to support 1080p, 720p android TV? - Android
I made subfolder in res\folder to support different screen size but am getting same result Like this
Could anyone please help me how can I target a full 4K resolution because right now my Webview looks blurry on 4K TV
I don't believe that it's possible to target a 4K resolution with your UI components natively. According to the Android 6.0 release notes around the 4K display mode:
While in 4K display mode, the UI continues to be rendered at the original resolution (such as 1080p) and is upscaled to 4K, but SurfaceView objects may show content at the native resolution.
I might be mistaken, but I believe the intention here is to allow developers to build their UI for a standard 1080p resolution without having to account for 4K, but this still allows native 4K video as that would be rendered to the SurfaceView.

Is it possible to combine 2 images together into one on watchOS?

I am upgrading my watch app from the first version of watchOS. In my first version I was placing UIImageViews on top of each other and then rendering them with UIImagePNGRepresentation() and then converting it to NSData and transferring it across to the watch. As we know there are limited layout options on the apple watch so if you want cool blur effects behind images or images on images they have to be flattened off screen.
Now when I re-created my targets to watchOS2 etc suddenly the images transferred via NSData through [[WKSession defaultSession] sendMessage:replyHandler:] come up with an error saying its too large of a payload!
So as far as I can see I either have to work out how to combine images strictly via watchkit libs or use the transferFile option on the WKSession and still render them on the iPhone. The transferFile option sounds really slow and clumsy since I will have to render the file, save to disk on iPhone, transfer to watch, load into something that I can set on a WK component.
Does anyone know how to merge images on the watch? QuartzCore doesn't seem to be available as a dependency in watch land.
Instead of sendMessage, use transferFile. Note that the actual transfer will happen in a background thread at a time that the system determines to be best.
Sorry, but I have no experience with manipulating images on the watch.

Photoshop tvOS LSR extension gives error

We're trying to create a tvOS application icon for our new tvOS application. We've downloaded the necessary extensions and the example .psd. We've tried to generate a preview using the plugin but it keeps saying it's missing a background layer.
I've added the layer, named it background, and locked it, but the same error keeps popping up.
I haven't used the photoshop plugin, but what it probably means is that at least one layer has to be the right size (e.g. 400x240) and has to be opaque.
Also, for what it is worth, you don't need to create a separate layered image unless the layers are of a different size. You can just drag the individual layers directly into the assets.

Cross browser Testing

Due to Bootstrap upgrade, there has been lots of changes in the CSS in all pages of the web application that I'm working on. This application is also mobile optimized. So I have the task the checking the UI of all pages of our application accross most browsers - IE8,9,10,11 , chrome, firefox, ios and android devices(phone, 7 inch, 10 inch).
Right now, I'm opening the existing version(old bootstrap) and the updated version(New bootstrap) of my website in 2 tabs, and switch back and forth between them to find out any UI issues like alignment and color change and text size.
Is there a better way of doing this?
Yes there are somewhat solutions to it, which make cross-browser and multiple device testing easy. Some of them are:
Ghostlab: allows synchronized testing which means if you click or scroll in one browser it happens across all browsers. It has many other features but is only for Mac.
Grunt also allows for synchronized testing. Check this article
you can do cross browser testing within a browser using online services such as
Last thing I would mention is xip.io just check it out!!!
Chrome DevTools are awesome for this purpose. They allow you to override settings for different devices by Developer Tool>Settings>Overrides you can override following to emulate
User agents
Device metrics
Device orientation
Touch events
CSS media

How to make SVG images be displayed in a mobile device?

I am building a QT application which I customize through QT stylesheets. The images I use for the controls are SVG images which are rendered properly when ran in Linux. But when I load the QT application into a mobile device, the SVG images don't seem to appear.
Does anyone know what's going on? What should I do to make the SVG images work?
First check the log file in your emulator and find out what is the error occurred:
svg while implementing on mobile device may fail because of the following scenarios.
1.Memory footpring issue because of different OS;mobile OS is relatively small in size.
2.Device type on which it runs.
3.Framework that is used for implementing SVG applications.The framework availability
4.Sometime image encoding can also be an issue.
So need to get a framework that support all these characters on mobile device.
Currently there are few open source and commercail frameworks available.You will get more from this link
http://developers.sun.com/mobility/midp/articles/s2dvg/index.html

Resources