I stumbled upon some strange behaviour of the Graphic Get PPI function in PBCC 4.04 :
The 1024 x 768 screen of my notebook measures exactly 12 x 9 inches.
Dividing both sets of figures gives me a graphical resolution of 85.3 ppi in both directions.
Using the Graphic Get PPI function, i can ask PBCC 4.04 to report the screen resolution,
which is reported as 96 x 96 ppi, about 12.5% too high. But it becomes worse.
I can change the screen mode to 800 x 600 or 640 x 480 pixels, and in all cases the graphic
resolution is reported to be 96 x 96 ppi, which is of course wrong.
I checked the various system settings, and could find nothing unusual.
I tried next the printer counterpart of this function, XPrint Get PPI, which appeared to work properly.
Specially in the case of a notebook, where all parts belong together and form one unit,
i cannot easily imagine what might have gone wrong. On the other hand i do not immediately
want to assume that there is something wrong with the compiler.
Does anyone have experience with this function ?
Arie Verheul
The 1024 x 768 screen of my notebook measures exactly 12 x 9 inches.
Dividing both sets of figures gives me a graphical resolution of 85.3 ppi in both directions.
Using the Graphic Get PPI function, i can ask PBCC 4.04 to report the screen resolution,
which is reported as 96 x 96 ppi, about 12.5% too high. But it becomes worse.
I can change the screen mode to 800 x 600 or 640 x 480 pixels, and in all cases the graphic
resolution is reported to be 96 x 96 ppi, which is of course wrong.
I checked the various system settings, and could find nothing unusual.
I tried next the printer counterpart of this function, XPrint Get PPI, which appeared to work properly.
Specially in the case of a notebook, where all parts belong together and form one unit,
i cannot easily imagine what might have gone wrong. On the other hand i do not immediately
want to assume that there is something wrong with the compiler.
Does anyone have experience with this function ?
Arie Verheul
Code:
' Testcode for Graphic Get PPI #Compile Exe #Dim All Function PBMain () As Long Local hWnd As Dword Local ClientWidth, ClientHeight, Hres, Vres As Long ' Set up a graphic window Desktop Get Client To ClientWidth, ClientHeight Graphic Window "",0 ,0 ,ClientWidth, ClientHeight To hWnd Graphic Attach hWnd, 0 Graphic Color %Black, %White Graphic Font "Verdana", 12, 0 Graphic Clear ' Get window size Graphic Get Client To ClientWidth, ClientHeight Graphic Print "Window "+ Str$(ClientWidth) +" x " + Str$(ClientHeight) ' Get graphic resolution Graphic Get PPI To Hres, Vres Graphic Print "Resolution " + Str$(Hres) + " x " + Str$(Vres) Do:Sleep 1000:Loop End Function
Comment