I used to develop for Android and iOS, and for multiple screen support we use to use mdpi, hdpi, xhdpi.
Now I want to develop for Windows Phone, I want to set a background to a button and I don't know how to define image size to support all screen sizes.
You dont need to provide different assets. See info from MSDN below.
There is a way to support different assets/resources. But we have never done this bevore in our apps.
From MSDN:
Assets such as graphics, video, audio, and icons make up a large
percentage of an app’s size. Including assets for all resolutions in
your app uses a lot of space in your app. For most apps, we recommend
that you include only WXGA assets. WXGA assets have the highest
quality, and they automatically scale to work well for other
resolutions.
More info: Multi-resolution apps for Windows Phone 8
Multiple resolution handling is built-in with WP8.1. You simply need to name your images with the proper qualifier to ensure it is loaded properly by the device.
You can refer to the tutorial here for more info on how to properly name your image resources:
Quickstart: Using file or image resources
Related
I am new to Windows Phone development, So my first question is :
In android we use sp when setting font size so that it sized according to its phone settings and screen size. But in windows phone I am setting font size in just a number like fontsize="16", Will it adjust itself or I have to do something else for it.
Just like that in android we have ldpi,mdpi,hdpi etc folders for multiple screen density images. In windows how can this be acheived? I have searched for this link but couldn't understand that article.
You can just use a single value for font sizes (and any other "pixel" sizes in XAML) and the platform will do the right thing so that the item is the correct physical size (uses the appropriate number of raw device pixels). The multiplier used for this is RawPixelsPerViewPixel although you don't need to worry about that detail if all you're doing is using text and static graphics (it's useful for things like DX interop, or dynamically downloading images from the network).
For how to provide images of different sizes, look into this MSDN sample.
It's my first time trying to publish my app on Google Play. I am using Xamarin 4.2 and C#.
My questions:
Can I use Microsoft Paint to create launcher icons?
My plan is to create 36x36px (ldpi), 48x48 (mdpi), 72x72 (hdpi) and 96x96 (xhdpi) launcher icons: Is this Ok so far?
The documentation says .PNG; I guess ldpi and mdpi are just naming conventions?
However my search found different numbers of icons and different sizes.
My plan is to place each of these icons under a separate folder as follows:
Resources\drawable\drawable_ldpi\ic_launcher
Resources\drawable\drawable_mdpi\ic_launcher
etc. Is this arrangement correct?
What about the high resolution application icon: Is it placed in the resources folder? or uploaded separately into Google play console?
First take a look at googles iconography guide: http://developer.android.com/design/style/iconography.html
As you can see each density has a name, you should create a drawable_(density) folder inside the resources directory for each one you plan to support and use the correct icon size.
As an example you should have Resources/drawable_mdpi (density ñame is always in lower case)
And for the hi res icon i supose you refer to the image for google play, it is uploaded when you fill your apps description.
About using Paint to create those icons, well, using paint for anything more complex than drawing a line is a bad idea...
If you don't have any program like Photoshop you always can use Gimp, its free and very powerful:http://www.gimp.org
I am Developing a Windows Store application. There are seven resolutions in Windows. I want to set different image sizes for different resolutions. Can any one know what are the image sizes for Windows Simulator Resolutions.
These are the resolutions Simulator provide:
10.6" 1024*768,
10.6" 1366*768,
10.6" 1920*1080,
10.6" 2560*1440,
12" 1280*800,
23" 1920*1080,
27" 2560*1440,
My question is Image sizes for these resolutions regarding Background Image, Launch image(splash screen). I want to Select image based on Screen Size. Guide me the what are the image sizes regarding of Screen size.
I searched through out in internet. Help me regarding this.
Depending of the kind of application that you are dealing with, the best option may be to scale or to adjust the image size.
Take a look a this resource Guidelines for scaling to screens (Windows Store apps) it will provide a complete picture of this very important topic.
In the same reference guide you have Guidelines for scaling to pixel density (Windows Store apps)
I truly recommend to read the MSDN reference to Windows 8 apps. It's very well documented and has tons of examples.
It's worth mentioning that the system can automatically swap images for you when the screen resolution goes above 140% and 180% of 1366 x 768. To take advantage of this "auto swapping" simply include three versions of your image:
MyImage-100.jpg
MyImage-140.jpg
MyImage-180.jpg
Then, when you reference the image in your application just reference it as MyImage.jpg. The system will take care of the rest.
If you need to swap images out at resolution thresholds other than 140% and 180% you will need to write your own custom code.
In addition to the great resources that Agustin has provided, please note that the launch image/splash screen must always be 620 x 300 pixels, regardless of your screen size/resolution. You can find this in your Package.appxmanifest file under the "Application UI" tab, at the bottom.
I am developing windows 8 metro app using XAML/C# .
I have added scaled versions of every images in the solution to support different screen resolutions .
Each image will have 2 additional copies in different sizes (100,140,180 %).
eg: sample_100.png,sample_140.png,sample_180.png
Now i want to know how can i choose the correct image based on screen resolution?
Us using a converter a good practice?
You don't need to do anything if you name them correctly. If you use names like
sample.scale-100.png
sample.scale-140.png
sample.scale-180.png
then you can use them in XAML by just typing sample.png. It automatically picks up the one with the correct resource qualifier.
Check this msdn article:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh965324.aspx
I am needing to render some custom PNGs in a Windows 8 app.
Basically I need to create a custom live tile by putting some drawings made in my app on top of an image for a live tile, and the only way to do this is render a PNG to disk, see here.
What library should I use to do this? My first thought was to use a Xaml UserControl and RenderTargetBitmap, but it is not available in a Metro app.
WinRT XAML Toolkit has some extension methods for WriteableBitmap that you could use too. You could probably use WriteableBitmapLoadExtensions for loading and WriteableBitmapSaveExtensions for saving. It has a fairly limited blitting capability though since that is exposed by WriteableBitmapEx already and simple to write anyway. WriteableBitmapBlitBlockExtensions is only a method to blit a full width block of pixels from bitmaps of same width.
Edit* RenderTargetBitmap is now available in Windows 8.1. It doesn't support some elements though (I think it doesn't render camera previews, media elements and perhaps WebViews).
Currently the only option is to use DirectX (or SharpDX) to create your image. You'll probably have to recreate the drawing using the low-level DirectX APIs.
WritableBitmapEx might also be helpful if your drawings are simple.