How to stretch the image when the user resizes the window in Scale Desktop 125% and 150% display mode?

Just starting out? Need help? Post your questions and find answers here.
hdt888
User
User
Posts: 57
Joined: Sun Jul 07, 2024 8:42 am

How to stretch the image when the user resizes the window in Scale Desktop 125% and 150% display mode?

Post by hdt888 »

I have 1 more window and 1 ImageGadget.
I experimented with 3 screen display scaling modes: 100% / 125% / 150%.
When i resize the window the image is distorted.

How to stretch the image for ImageGadget() when the user resizes the window in Scale Desktop 100% / 125% / 150% display mode?

Thank for support.
Last edited by hdt888 on Sun Nov 03, 2024 3:50 am, edited 1 time in total.
PB 5.x + 6.x + Win10. Feel the ...Pure... Power.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4991
Joined: Sun Apr 12, 2009 6:27 am

Re: How to stretch the image for ImageGadget() when the user resizes the window in Scale Desktop 125% and 150% display m

Post by RASHAD »

Hi
1 - Keep the original image as it is let us say it's Image 0
2- Copy image 0 to 1 then resize 1 to 125 % and use it
3- Copy image 0 to 2 then resize 2 to 150 % and use it
And so on
Egypt my love
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: How to stretch the image for ImageGadget() when the user resizes the window in Scale Desktop 125% and 150% display m

Post by Fred »

It's also better to have a larger original image and scale it down to lower resolution to avoid blur
hdt888
User
User
Posts: 57
Joined: Sun Jul 07, 2024 8:42 am

Re: How to stretch the image when the user resizes the window in Scale Desktop 125% and 150% display mode?

Post by hdt888 »

thanks RASHAD, Fred.

I modified the code, using only 5 basic functions, everything works smoothly.
CopyImage(), ResizeImage(), FreeImage(), SetGadgetState(), DesktopResolutionX().
PB 5.x + 6.x + Win10. Feel the ...Pure... Power.
Post Reply