View Single Post
Old 13th July 2020, 01:36   #11
Junior Member
Join Date: Jun 2020
Posts: 10
Thank you so much Nitorami. Apologies for not answering sooner, but I wanted to check things out thoroughly before replying and have been short of time.

I have used your example with every combination of screen ratio and image ratio - 18 in all! First I used the code in the solution you sent me and it looked fantastic, with all types of image and screen - always centred, with any necessary tiling at 50% brightness to emphasise the main image in the centre. Scaling was set by the following code:

scale =*texsize.xy * min(sz.x,sz.y);

However, it still wasn't exactly what I asked for, ie image fitted in centre with no distortion or tiling, so I looked at your code and thought what happens if I change min(sz.x,sz.y) to max(sz.x,sz.y) - and it did exactly that! So now I have two great solutions.

To demononstrate I have attached three images showing each main screen ratio - square, wide and tall, and what happens if a square, wide, or tall image is used with either min or max in the scaling equation for each screen ratio.

In all cases the results are controlled and look good. So, I'd say the problem is solved. Thank you so much!

PS There is no way I could have worked this out from the manual - it's way too difficult for me to understand.
Attached Thumbnails
Click image for larger version

Name:	Fit to Square Screens 1-1.jpg
Views:	390
Size:	890.5 KB
ID:	54620   Click image for larger version

Name:	Fit to Wide Screens 3-1.jpg
Views:	366
Size:	892.6 KB
ID:	54621   Click image for larger version

Name:	Fit to Tall Screens 1-3.jpg
Views:	402
Size:	787.7 KB
ID:	54622  
NeonAngel is offline   Reply With Quote