Change window size.

Pixilang programming language
Post Reply
martblek
Posts: 6
Joined: Fri Dec 09, 2016 9:42 pm

Change window size.

Post 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
}
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Change window size.

Post 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.
martblek
Posts: 6
Joined: Fri Dec 09, 2016 9:42 pm

Re: Change window size.

Post by martblek »

Ok, thanks.
Post Reply