PNG image not showing in Eclipse ImageView - android

I am using the Eclipse drag 'n drop feature to add a PNG image to my app UI.
When I drag the ImageView widget from the menu into the UI area it asks me to select the image from a list. I have named the picture image1 and when I select it there is just a placeholder image (a red cube with Aa in).
I have tried re-sizing the image and using different images. The placeholder image is visible on my UI but nothing I have tried can made the actual picture I have put in my xhdpi folder show up on the screen.
Any help much appreciated.

I'm not entirely sure why but when I changed the filename from image1.png to image2.png it worked.
The placeholder image that I kept seeing was listed higher up in the hierarchy as image1-web.png so I wonder if that was taking precedence.

Related

Android Studio for Mac: Use original colour image for splash screen

I have a multi-color image that I wish to use on a splash screen. I am using a guide from here which requires specifying the image under a AppTheme.Launcher style, and using the item android:windowBackground to specify the image name through #Drawable/SplashIcon
I am stuck on how to actually add the image to the project. I have so far been adding images using the menu action new -> Image Asset which flattens the colour and doesn't seem to have an option to just import as is.
I have resorted to drag and drop onto the drawable folder in Android Studio, which adds the image, but I cannot reference it using Drawable/SplashIcon.
Here is what I have:
How do I reference my image?
Seems like it is an issue with the file name. Have to use lowercase letters and underscores for the file name, nothing else.
I therefore drag and dropped my image with the name splash_icon.png and it's now appearing under #drawable/...
I am also now using the different pixel densities too, as recommended.

Drag one image at a time to the top of another image

I have 4 images at the bottom of my screen (but in the future I can have more) and 1 image at the top.
I would like to click on the bottom images one at a time and drag to the top image and at the end save the image from above with all the images.
Note: The user can drag one, two or no image so it depends on it.
I have an example below:
enter image description here
Any tips on how I can do this?
Any API?
Or a Framework?
Any examples in git?
You can download this example and change it to meet your requirement.
I just tested and it works perfectly on Android emulator.
Here is a gif:
Refer: xamarin-imageview-drag-sample

Skip transparent background in an image when setting an image as background in android

I am working on a project in which I am using a lot of images. My friend has designed all the images in photoshop and all those images are of my required size.
But the problem is that when my friend exported those images from the photoshop, he exported those images with a transparent background and that transparent background with the image makes the frame size bigger than required. And when I set that image to some ImageView, it expands to the whole screen due to its bigger frame size.
Now my question is that Is there a way to set image in imageview so that the transparent part is automatically ignored and the image of my required size just sets into the imageview. Or It is required to crop those images in photoshop and then use those images.
I am sorry if someone couldn't understand the question but I can elaborate if asked.
The way I would do it would be just edit them in photoshop, but I found another way if you want to look into it. Its called webP and you can check it out here. With this you can skip the transparency, but I think the size would stay the same, You can try it out if you want though.
Hope this helps!

Imageview looks like mapview

I have a image (resolution 8328x3987). And I want to load that image in my app with zoom controls for better viewing.
As we all know that Android will not load large images directly on device (like in my example). So Android system suggested us to scale down the image to load large images. I have tried this and scale my image upto four times as:
options.inSampleSize = 4;
Using this way my image will displayed on screen, but when I zoom-in the image then this image becomes unreadable (text becomes very blurry), this is because, maybe I scale down the image before showing?
But when I see that image in to device's default gallery app (Android Lollipop, Photos app), then this image looks like a mapview (only visible portion is readable and outside is blurry, and when I move the image then visible area becomes readable) when I zoomed in at max level. So my questions is:
Is Android lollipop added any new way to load large files that looks like mapview?
If not, then do you have an idea how that apps do this or any example?
Reducing the sample size of an image that big will not work at all.(very very bad resolution and memory consumption)
I suggest you to divide image to tiles and recycle the views just like map views do.
This library may help you. Or you can do it your way too.

Handling Multiple images in svg image Android

I am working on a simple app in SDK Android and i have the follwing problem:
I have already converted my png. images in SVG and now i want to make them interract.
The problem is that the whole image is made up from other images or text fields etc.
So, as i have saved it in .svg format i want to find a way to handle for example the button, when clicked, that exists at the center of my photo, the scroll bar at the bottom, when clicked etc in order to go to another svg image. I don't know how i could handle them seperately, as i save the whole image as svg that contains all the above parts..
Thanks in advance

Categories

Resources