When making background images what are the best pixel dimensions and resolution for them?
Last edited:
If it's just a pattern background that doesn't really lose quality when downsized I just make it 800x1280 for portrait and 1280x800 for landscape. Then I just user LoadBitmapSample to efficiently load it.
Now if it's a background image then you can import an image for each device size ( ldpi,mdpi,etc.)
Dim BG As Bitmap
BG.InitializeSample(File.DirAssets, "background.jpg",Activity.Width,Activity.Height)
Activity.SetBackgroundImage(BG)
The simplest approach is to use LoadBitmapSample(..., 100%x, 100%y).
Currently the designer internally uses LoadBitmap to load the images. It will be changed to LoadBitmapSample instead.
Dim Image1 As Bitmap
Image1 = LoadBitmapSample(File.DirAssets,"background.jpg",100%x,100%y)
Image1 = CreateScaledBitmap(Image1,Activity.Width,Activity.Height)
Activity.SetBackgroundImage(Image1)
On high resolution devices / tablets 100%x * 100%y might be too large. You can load a smaller image instead. Note that CreateScaledBitmap will not help here.