Adapt the display of a form to the screen resolution (Delphi XE8) - alignment

I'm having trouble solving the problem of adapting the display of a form according to the resolution of the screen.
I wrote my code in a 15 inch laptop, I'm using 1366X 768 resolution, The form fills the screen perfectly, and the display is as expected
but when I open my application in another computer with a larger screen (1920x1080 resolution), the shape takes up the whole screen, but the display of objects is not as expected, , there is too much space..
I am looking for a way to adapt the appearance of the form according to the screen, i.e. to make the display look like photo 1 whatever the screen resolution
I tried to play on the properties of the form (Align,Anchors Autosize..), but it did not work

Related

UI size changes when switching to a different device

So I am quite new to Unity Development, and I have run into a problem. I have two UI's in my game (two buttons), however, when I change the device from an Iphone 12 (landscape) to a Iphone 11 (landscape), the UI's ratio goes all whacky and it changes size. Is there any way I can prevent this? I will link photos below
So this is what it looks like if the camera is in the Iphone 12 landscape 'mode'
and this is what it looks like in Iphone 11 'mode'
The ratio and size of the UI goes all whacky. How do I fix this?
(a picture of my canvas inspector
One thing that comes to mind is to change the Canvas Scalers UI Scale Mode from "Constant Pixel Size" to one of the other options, depending on what works best for you.
Unfortunately, "Constant Pixel Size" is the default value and it usually breaks everything when building a full screen UI.
For canvas settings, use the "scale with screen size" option and play around with the values. If most of the resolutions look fine but there is a spesific one that straight up breaks your UI, you can write a script to check if its that resolution and change the canvas values.
For UI elements you can play around with the setting I circled in red.
Also you might want to check this thread.

ios swift crop image to the size of device

everyone. For the App on which I am working I want to let users be able to select own image and set it as the background of App. The Problem I face is how to let users crop the image fitting the size of device's screen if the image is larger. Another question is if users want to select a pretty small image and set it as the background, should I just say no to it?
We don't know how you've set up your app so we can only speculate. BUT you could create a UIImageView that is behind everything else. When the user selects a picture just set that picture to that image views background....
As for the cropping...if you use constraints and tell that image view to be 0 from top, 0 from left, 0 from right, and 0 from bottom it will automatically resize based on size of device. Also you would need to set that image views scale property so the image doesn't distort...
Finally, usually when you have images on the device you create a 1x, 2x, and 3x size and Xcode will automatically use the appropriate size ...but again we have no idea how your app works...so if the user is trying to use an image that is 15 pixels by 15 pixels and have it fill the whole screen...it's going to look pixelated
You might want to write a function that gets the image size and if it fails to meet specifications you set...tell the user somehow (UIAlert...)
All of that being said...
Folk here on Stack Overflow generally don't take time to help on questions that have no code example shown...generally speaking you attempt to figure it out first and then post...so show code that you've tried, or take a screen shot of how your View Controller looks like...

Print full page delphi

Whenever I print a from in delphi, it does not print to the entire page. It uses all the page horizontally, but it only uses about 3/4 of the page vertically.
My code is :
printer.Orientation:=poLandscape;
form1.PrintScale:=poPrintToFit;
printer.Copies:=spinedit1.Value;
form1.Print;
Any suggestions ? Thanks
I have tried changing form sizes and trying other printers will no result, it prints exactly the same thing.
You are getting exactly what you want. The printer is producing an image of the screen that is 1963 by 1056 which should map nicely on to the top 3/4 of your 11.7 x 8.3 paper. The top 3/4 would be about 11.7 x 6.2. (1963/1056 is approximately equal to 11.7/6.2) You are printing an image with the aspect ration of about 2 to 1; the printed image has the same aspect ratio. If the printed image filled the entire page, it would be distorted in such a way that it looked either too tall or too narrow, depending on your perspective. You would see this more clearly if you were to throw some other controls onto the form near the corners. They will show up on the printed page.

How do you fit a large png image into a smaller custom Round Rect Button on XCode without losing image quality?

I am creating a button for my application that, when pressed shows an indention looking effect to make it appear that the user is clicking a real button. It is very simple, using only an image for the default state and the depressed one for the highlighted state. I'm having a few problems. The quality is terrible. I have uploaded the images to XCode in the exact pixels they will be presented in my application but when I export it from Illustrator it gets really pixelated. So I was wondering if there was a way for me to upload an image a few times bigger than my button and have it shrink to fit the button size. I've tried to do that but when I run my app it gets really messed up and weird looking. I would just put text inside the button but then it ruins the pressed effect. Any ideas?
If you export an image at the same aspect ratio as the button, the image will be re-scaled to fit within your button. Don't forget to use the Custom style so you don't get the button oval.
However generating an exact pixel version of your button should be possible, and look good - especially if you specify a 2x sized #2x version of the image for retina use. Are you sure your Illustrator export settings are correct? One thing to consider is that perhaps anti-aliasing needs to be enabled on export.
This page has a helpful quick checklist for how to save for the iPhone from Illustrator (Scroll down to the "How To Save Art For The iPhone In Illustrator" header)
http://www.vickiwenderlich.com/2011/11/faq-how-do-i-save-art-for-the-iphoneipad/

iOS webview scaling to match retina display

I'm using a full screen UIWebView to house/render an HTML5 application under iOS. Very much like Cordova/phonegap although I'm not using those. I try to make my webview size match the underlying display. Unfortunately, on retina displays, the value returned by self.view.bounds relies on the UIScreen scaling factor. So I get 1024x768 instead of 2048x1536. Not a huge problem except I then instantiate the UIWebView using the smaller bounds (after adjusting for the status bar) and some things get a bit jaggy. In particular, I use canvas at a couple of points and also rounded borders appear thick. To be clear, this isn't a case of scaled raster resources.
I'm not getting the full resolution of the screen using that UIWebView. Ideally, I'd like to set the screen scale to 1.0 but that doesn't appear to be supported. Any suggestions on how best to get full advantage of the screen?
The problem is most noticeable on the iPhone 5 simulator. I don't have that hardware to test on. iPad/new iPad I think has the problem but the jaggies aren't as noticeable.
Update: The more I look at this, the more I think it may be restricted to canvas.
Solution: In case anyone else gets here. Based on the answer below, I created all of my canvas elements with width and height multiplied by window.devicePixelRatio and then set their style attribute to have the original (device independent) size.
See https://stackoverflow.com/a/7736803/341994. Basically you need to detect that you've got double resolution and effectively double the resolution of the canvas.

Resources