I use TImage (in Delphi XE5, FMX) in my app.but all of the components can be seen except TImage content on some devices.
I try to display any pictures in bitmap or jpeg formats. I set bitmap in MultiResBitmap property in DesignTime or load jpeg image in Runtime.
For example on Device : Samsung Galaxy S Dous2 Android 2.3.6 , HTC ONE M8 Android 4.4 , Huawei Tab 7 android 4.3 , Huawei P6 Android 4.2.2 TImage Content can not be seen and Show a black rectangle. on other devices TImage worked properly.
You should first make a multiresbitmap with the Editor
And then load the Multi-Resolution Bitmap
Related
I am using this library to load 360 panorama image,
Its working fine in some devices like google pixel 2 and Nexus 5X but in some devices its not working, How can I make it work on all devices?
Any help appreciated.
I'm working on an Xamarin Android app and have a background image that I use. It works great on almost all devices except LG G3. I see that it has a 1440x2560 resolution, I tried putting the background image to that resolution too in the Resources but it still doesn't show. Does anyone know which would be the right resolution that I should use ?
Thank you all for your help !
I have created a 2D game in Unity and have successfully created it PC build now I want to port it on Android devices. I have created the android build and It works on most of my android devices except on Samsung Galaxy tablets. On Samsung Galaxy tablet devices, it does not display the main menu backgrounds.
I have checked dimensions of the image these are 2048 X 2048.
In the inspector of unity the properties of image are asss follows:
type is sprite, max size is 1024 and compressed
On other android devices,(google nexus, micromax phones, bluestacks) it displays the images properly. Can anyone please guide me?
You also have to set you image as "Sprite" from Inspector.
Hi I found out what I was doing wrong.
the textures were not appropriate according to the resolution of the screen. After I created another set of textures and setting the compression and max size to 2048 X 2048 it started displaying.
NOTE: this issue only occurs on certain android devices (note 2, s4), looks like only on samsung devices but cannot confirm this 100%
So I needed to load a mobile website inside a webview, now the logo in the header of the website gets displayed very pixelated, like it was downsized and then upscaled...
I tried everything: transparent png, jpg with correct background, svg, bigger image, perfect size image, smaller image,... Image didn't went over 10kb.
Any idea what could go wrong...
EDIT: included screenshot
On the left the icon showed on HTC One, HTC One X, Nexus 4, Nexus One
Right: Samsung Galaxy S4 and Note 2
i recently developed a game, for Android 2.3.3, and strangely im finding few weird behaviour in different phones,
for example
An explosion sprite(256x256 pixels) divided into 4x4=16 images, when displayed is being displayed as a 2x2 image in Samsung Galaxy Ace 2.3.3 and Samsung Galaxy Y, 2.3.5 ,
Also, the accelerometer works in a haphazard form in Sony Xperia 2.3.3 and Samsung Galaxy Ace.. either its too slow(and takes touch gestures after 3-4 second gap) and Android OS throws a Alert box saying, the app is not responding, else its too fast.
Strangely, The game works perfectly on a Samsung S2, just like it plays on the VirtualBox..
please help me, b'cos this is my college project, and I wont even be able to put this up in the market if such a queer problem exists!!
Thanks in Advance!!
I think I have the same experience with the graphics problem:
From your code, I'm guessing you may have pre-computed "width_explosion" and "height_explosion" from the image height/width you have seen in an image editor and using the same values on different devices.
The device you have listed have two different DPI values as Android knows: 240, or MDPI (Galaxy S2) and 120, or LDPI (Galaxy Ace and Galaxy Y). Note that Galaxy S2's DPI is exactly twice as Ace's and Y's.
Android makes it handy for app authors by assisting them in manipulating images. When images are read from resources through getDrawable and are ready for rendering on screen Android resizes the images with respect to 160DPI, so that they will have the same length measured with a ruler on screens with different pixel densities. For example, if an image with 128x128 pixels is 2cm long and 2cm wide on Galaxy S2, it should be 2cm long and 2cm wide on a Galaxy Ace. However, to cover the more pixels on a Galaxy S2, it's resized to 192 x 192 pixels when drawing on a Galaxy S2, because its DPI as the Android system knows it is 240, 1.5 times the DPI of an ADP1 (HTC Dream). Similarly, the image will be resized to 96 x 96 on a Galaxy Ace or Galaxy Y.
The source rectangle in canvas.drawImage, unfortunately, refers to the number of pixels in the resized bitmap. That means the same source rectangle used in your code sample covers 4 times as many pixels on a Galaxy Y as it does on a Galaxy S2. I guess you are describing in the question that "the same sprite file looks like it was divided in 2x2 on a low DPI device but it should be divided by 4x4".
The following example illustrates what happens when I'm trying to replicate your question with devices with different DPIs.
I cannot post images, so I have put the images here (it's my blog):
http://edgeofmap.com/blog/2013/05/android-bitmap-over-devices-of-different-dpis/
Not sure what to do about the graphics issue, but for the accelerometer each device acts differently. Use event.sensor.getMaximumRange() in your onSensorChanged() to get the maximum value and base your actions on that or a percentage of that.