How can I prevent automatic image rotation? - jasper-reports

In Jasper report when the size of the image is huge it rotates the image automatically. How can I prevent that?
First picture: 3024x3024 px 2MB
Second picture: 1125x1500 px 300KB

I think your problem is with the Scale Image property. Try to change it to Retain Shape

Related

How to get rid of a jaggy ImageView border when scaling down a big image?

I have a bunch of round Images. They are in png with a 512x512 size. I took them from Flaticon.
To display images in a tableView I use imageView with a 45x45px size and Content Mode as Aspect Fit. Images put in a project assets.xcassets folder with a Scale property as Single Scale.
When images displayed by a tableView a jaggy border is visible in every image:
And its visible without zooming in:
Is it a problem with source images? How to make the image border smooth?
The issue is with an image that you have added.
Please use a normal image and give corner radius to image view as below
self.imageFlag.layer.cornerRadius = self.imageFlag.frame.size.height/2
This will resolve your issue
Below is the screenshot

how to calculate PPU for image sprites

I have an image for creating rounded button in unity, but, If I don't account for the correct PPU value, the button gets distorted (I'm even using sliced images):
Through trial and error, the PPU value of 300 seems to look like the original image:
but, I don't know a way to confirm if that is correct. How would we actually calculate the PPU value to use for images?
I think you just need rounded rectangle image and need to slice it as follow
I have sliced the image as shown above and added an Image component in scene like following
Notice the Pixel per unit multiplier it is to control the border radius, and now I can stretch the image and it won't get distorted. Check the screenshots for that
And for the text I have used TextMeshProUGUI as the child of the Image.

UIImagePickerController capture full screen on iphone

I'm using UIImagePickerController class to capture image from camera.
When is captured, I save the picture on disk. After that I use imageWithContentsOfFile method to load this image as background of the main screen.
The problem is that when I load the picture appears 2 white bands on top & bottom of the view.
My question is how can I take a picture with 320X480px of size in order to load it full screen?
Thanks.
--EDIT--
The originalImage when is captured sizes this:
INFO -> Captured Image Size W:480.000000 H:640.000000
How can I get the image directly 320X480px?
Thanks.
Presumably you get white bands because you've got the content mode of the UIImageView you're displaying it in set to UIViewContentModeAspectFit which means resize the image, maintaining aspect so that it you can see the entire image. If you set the content mode to UIViewContentModeAspectFill it'll do what you want.
The reason for this discrepancy is that the aspect ratio of the screen (2:3) is not the same as the aspect ratio of the images that come from the camera (3:4).

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.

How to fit a large image in image view without stretching the image?

I am using a image view and its size is (320X480). i want to fit a image which size is (800X600) in image view without stretching the image. i tried to make the image 320X480 but its quality becomes poor. Thanks for any solution.
320x240 would be the same aspect ratio. Notice, 800/600 = 4/3 and 320/240 = 4/3.
Also, in the future a tool like ImageMagick can allow you to resize an image to fit within some bounding box while maintaining aspect ratio.