Page 1 of 1

Change window size.

Posted: Fri Dec 16, 2016 3:43 pm
by martblek
Hi all,
Is possible automaticaly change window size to loaded container?
I played with set_pizel size and resize but it is not what i need. window size is still 480x320.

2. How is PPI calculated. Change is posible using set_pixel_size. default is 110PPI but on my monitor is ~96.
I'm using this value for converting coords from image to real coords so 1px on my monitor is 0.2625mm not 0.2309.
I know its only 0.03mm difference but on 2000px width image is too much for me.
Any idea how to get real monitor resolution and hw size for calculating real PPI for monitor ?
thanks.

Code: Select all

fn px2mm($px)
{
	ret((25.4 / PPI) * $px
}

Re: Change window size.

Posted: Mon Dec 19, 2016 9:18 pm
by NightRadio
Is possible automaticaly change window size to loaded container?
No. You can only set the default window size in the pixilang_config.ini
How is PPI calculated.
It depends on the system. In Windows, Linux and OSX the PPI is not equal to the real monitor PPI. If is just some default value. But you can change it in pixilang_config.ini file if you know your real monitor PPI.
set_pixel_size will not affect the PPI. PPI is on the global level (outside of the Pixilang). set_pixel_size() is for the Pixilang userspace only.

Re: Change window size.

Posted: Mon Dec 19, 2016 11:02 pm
by martblek
Ok, thanks.