This project is read-only.

Confusing size

Nov 10, 2009 at 2:31 PM

Hi everybody!

I find this project very interesting. But when I tested it it looked quiet curious. The application was located at the top left quarter of the screen. Was it because I used libGLES_CM.dll ???

Thx

Nov 10, 2009 at 11:12 PM

Hello,

it would be helpful if you tell me more details about your device. what brand is it and what resolution does it have? you can try it without libGLES_CM. this is actually only included for testing purpose and you should always use the existing libGLES_CM of the device since it depends on the hardware. Just try it without and tell me if it works, please.

 

 

Nov 11, 2009 at 8:44 AM

Hi Thomas,

I'm using the Microsoft Device Emulator Version 3, 9.0.21022.8 - Windows Mobile 6 Professional. Without the libGLES_CM the app doesn't seem to start at all.

Hope that helps a bit...

Michael

Nov 13, 2009 at 3:06 PM

I also have the quarter-screen issue when running in Omnia (which is 240x400)

Nov 14, 2009 at 10:22 PM
Edited Nov 20, 2009 at 3:01 PM

I have also spotted that the scaling does not work properly on 320x240 screens (I tried it on an old RX3715 HP pocket pc - It also doesn't seem to work on the emulator) . I have managed to get it using the screen properly by commenting out the following line of code in Screen.cs:

 clientSize = Window.ClientSize;

and adding these two lines of code instead 

clientSize.Width = Control.UnscaleX(Window.ClientSize.Width);

clientSize.Height = Control.UnscaleY(Window.ClientSize.Height);

 

It seems the scaling was being applied to the screen resolution.

There is still an issue with the scaling of the texture images but I am looking into it.

 

Dec 1, 2009 at 10:16 AM

In fact, the reason is below

 

private const float ScaleDPI = 192f;

So, if you run your program on 240*400 screens, just modif ScaleDPI = 96f;

Try it!

Good Luck!

 

Dec 3, 2009 at 11:32 AM
Edited Dec 3, 2009 at 11:35 AM

Hi *,

the main problem was indeed solved by

private const float ScaleDPI = 192f; (located in Silvermoon.Core.Screen.cs)

Thx Listen for that line!

Nevertheless I had to adjust some dimensions in the KeyboardPanel.cs to use the keyboard panel properly:

const int KeyboardHeight = 112;   // 224
const int keyHeight = 24;  // 48
const int keyWidth = 24;  // 48
Size = new Size(240, KeyboardHeight); // 480  
int w1 = 37; // 74

Michael 

Dec 3, 2009 at 9:30 PM

Yes but that will limit it for that single resolution. By using andrewje fix it works fine for any resolution without having to add any autodetect mechanism.

Dec 4, 2009 at 4:04 AM
JohnWayne wrote:

Hi *,

the main problem was indeed solved by

private const float ScaleDPI = 192f; (located in Silvermoon.Core.Screen.cs)

Thx Listen for that line!

Nevertheless I had to adjust some dimensions in the KeyboardPanel.cs to use the keyboard panel properly:

const int KeyboardHeight = 112;   // 224
const int keyHeight = 24;  // 48
const int keyWidth = 24;  // 48
Size = new Size(240, KeyboardHeight); // 480  
int w1 = 37; // 74

Michael 

Just see here >> DPI-Aware NetCF V1 Apps

private static int dpi = SafeNativeMethods.GetDeviceCaps(IntPtr.Zero, /*LOGPIXELSX*/88);

private readonly int constDPI = 96;

const int KeyboardHeight = 112 * dpi /constDPI;   // 224
const int keyHeight = 24 * dpi /constDPI;  // 48
const int keyWidth = 24 * dpi /constDPI;  // 48
Size = new Size(240 * dpi /constDPI, KeyboardHeight); // 480   
int w1 = 37 * dpi /constDPI; // 74

 

then everything is solved!