How can I resize image in pub package "flutter_native_splash"? - flutter

I am using flutter_native_splash 1.3.1 package to add splash screen to the app.
The image size is getting displayed bigger than the desired size on the splash screen. What is right approach to decrease the size of the image on the splash screen?

Unfortunately, I don't think you can do it. So the option is to resize your image to fit your screen. You can read about the resolution in this topic https://github.com/jonbhanson/flutter_native_splash/issues/89

I was having issues with this. I tried a lot of different suggestions from stackoverflow, but nothing worked. I eventually just added padding within the image around the logo I wanted to display. So the logo was about 1/3 of the image, centered in the middle and then used center for gravity
<bitmap android:gravity="center" android:src="#drawable/splash" />
The images are all called splash.png.
The images sizes were all squares and had the dimensions:
hdpi 192X192,
xhdpi 288X288,
xxhdpi 384X384,
xxxhdpi 1024X1024

It is stated in the documentation that the image will be stretched to fit the screen. I think the best solution is to make your image with an aspect ratio of 9x16 (portrait) so the proportions stay the same.

Related

How to keep the same resolution of canvas on different screen resolution?

First of all, sry for my English mistakes, I'm not a native English speaker.
I'm trying to make an UI which is composed of a canvas within different gameObject, and I would like that my canvas scales to the dimension of the screen but keeps its original resolution (16x9 portrait). If it is displayed on a tablet resolution (4x3) then an image is displayed in the space that is not covered by the canvas.
But actually all I've got is a canvas which scales to every resolution, and it changes the aspect of its child (for example a square becomes a rectangle).
Thank you for showing interest in my query!
UI's are heavy beasts. Canvas in Unity have a component attached to themm called Canvas Scaler which is set by default on Constant Pixel Size. You may try to set this property on Scale With Screen Size and then specify the base resolution you want to work with (usually 1920x1080 is a console standart). This is your first step
Then, to avoid strange Image scaling, you may check the property Preserve Aspect, this way the ration of the Sprite into your Image will remain the same indepently of the ratio of the Image
Last, you may play a bit with anchors but this is another story, you should let those at plain center at the beginning and come back to it when you will feel ready
Hope that helped ;)
Your canvas should have a component called Canvas Scaler. Here it should say Constant Pixel Size, change this to Scale With Screen Size and it should lock the Canvas to be the same width / height as the screen. If you want to lock an image to a specific width/height ratio, go to the Image component on the image and check the Preserve Aspect checkbox. This way if you have a 100x100 image, the images width will always be the same as the height. If you have a 200x100 image, the images width will always be twice the height, etc etc etc.

Image size incorrect in Unity

I have a Unity 2D project with a fixed screen size of 800x450 pixels.
I have imported a background image that is also 800x450 pixels.
When placed on the stage, the image only takes up half of the screen.
The scale of the image is set to 1,1. The Z position is 0.
Why is the image displayed too small? How can I display the image at the correct resolution?
Does this mean that I have to design all my game assets at 2x the required size? Or that I somehow have to set the scale for all imported assets at 2? What is the recommended workflow?
EDIT
I have added a screenshot of the camera settings:
I would trying making your camera orthographic, and set the size of the camera (not the transform) to be half the height that you would like it to be (225)
Also if you are looking for pixel perfect game. here is a pretty good article from Unity about how to make that work and it explains some of the camera aspect ratios and scaling
http://blogs.unity3d.com/2015/06/19/pixel-perfect-2d/

Whats the image size to keep in list view of size 70x70 in android

I have the listview with each row have an image on left side and text on right side. I have the xml as shown in below.
<ImageView
android:id="#+id/ivMenuListImage"
android:layout_width="70dip"
android:layout_height="70dip"
android:layout_alignParentLeft="true"
android:scaleType="fitXY"
android:paddingLeft="2dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"/>
I have given the Height and Width as 70x70 and the Images are in higher pixels than this. The list view is displaying well. Now i dont want to use hardcode value. So i gave width and height as wrapcontent and resized the images as 70x70. But the images are looking very blured and image quality is very poor. Please help me.
If your image does not have higher resolution you may need to set
android:scaleType="centerInside"
in order not to stretch the image.
Update:
If you wish the row to appear "larger" on higher dpi devices, first you 1) set all your views' layout_height to wrap_content 2)Create png images with fixed width/height pixels for different density drawable folders. For example, in drawable-mdpi all your png images should have fixed height 70 pixel, then all the rows will appear to be 70dp high in mdpi devices. If you create images of height 96 pixel in hdpi folder, then all hdpi devices will look wider with 96dp height.

How can I fit a video screen on iphone using a plist

A video size is dimensions: 480 × 270px. Codecs: H.264, AAC With subtitles and it fit the width but it leave black gap on iphone screen: top and bottom of screen.
Can a video be forced to fit the screen according to height dimensions to fit the screen (4:3 aspect ratio)
I'm aware of UIViewContentModeScaleToFill in the contentMode. But I don't know how to use it in Xcode? If it is possible to have something similiar with UIViewContentModeScaleToFill in a plist?
See screengrab the bottom 3rd iphone is a preferred result.
align top http://www.kerrydeaf.com/1full.png
UPDATE: p.list in Xcode 4.5
align top http://www.kerrydeaf.com/plist.png

iPhone - UIButton background image is cut off sometimes

I am using a custom image as the background image for my buttons. I have noticed that the edges of the buttons are cut off sometimes. My buttons vary in size but the behavior doesn't seem to be dependent on the button size. I am creating the buttons programatically. The image I am using is pretty large to cover the entire background.
Can someone please let me know what could be the issue?
More info
Setting the content mode to UIViewContentModeScaleToFill still cuts of the images. Also tried resizing the image but doesn't make a difference.
Thanks.
Did you try setting the button's dimensions to fit exactly the image?
Is the image just cropped or also blurry (cause it's being resized)? Have you toyed around with UIView's contentMode property for the button?
If you did, did you try increasing/decreasing the width or height by a pixel? I sometimes had blurry buttons even though its dimensions were exactly the image's. Adding or removing an extra pixel sometimes helped.
I finally resolved this by creating a 3x3 px image with the background color as the button's color and a 1 px border surrounding the image. Then used the UIImage method stretchableImageWithLeftCapWidth:topCapHeight: to create an image with the desired border size of 1 px.