Display Orientation and Stylus Problem HP pocketpc 2005
Hi Edge,
I found a problem with Stylus using the IPAQ TRAVEL COMPANION RX5700 PocketPC 2005 device.
I have config the Display Orientation to ROT_NONE (also tested with ROT_AUTO). The device (IPAQ TRAVEL COMPANION) is configured to PORTRAIT mode (No Rotation). So, all applications are running normally (No Screen Rotation). But when i run my application the Display change to ROT_LANDSCAPE mode.
The problem is that the display is LANDSCAPE but the Stylus input is with PORTRAIT mode.
Imagine that in PORTRAIT mode ScreenWidth=240 and ScreenHeight=320, but when my application run ScreenWidth=320 and ScreenHeight=240 (LANDSCAPE mode). When i click somewhere the Stylus x,y are calculated with ScreenWidth=240 and ScreenHeight=320.
I made a temporary solution by changing myself the Stylus coordinates in all Stylus events, but i'm not able to recognise when and in what devices that happens.
I tried with GetSystemRotation function but it returns 0, so i can't recognise the real orientation.
Thanks for your help!
Hi Mimispa,
Can you tell me the settings you use in EDGECONFIG? I think the problem is caused by GAPI or the alternative method for opening the display device.
To use GAPI use the following configuration:
config->resolution = ERS_EMULATELOWRES
To use the alternative method use the following configuration (when using Embedded Visual C++ also enable native high-resolution by modifying the resource file):
config->resolution = ERS_DEVICEDEFAULT
Also try to create a native Windows Mobile 2005 build to use DirectDraw and see if that solves the problem.
Hi Edge,
I,m using config->resolution=ERS_DEVICEDEFAULT, config->videotype=EDSP_DEFAULT, config->rotation=ROT_NONE.
I think i'm creating a native Windows Mobile 2005 from Visual Studio 2005 building with POCKETPC 2005 SDK ,with no other things from NET Framework (if you mean that)
With the specific settings did you detect that kind of problem or it's only in the specific device? Because i tested with 5-6 different PocketPC (2003 and 2005) and all works fine.
Hi mimispa,
You're the first one to report this bug, it seems to be a device specific problem.
Would you like to create the native version using Visual Studio 2005 targetting Windows Mobile 5?
I'm sorry, i don't understand what you mean "native version using VS 2005 targetting Windows Mobile 5".
Now I'm using VS 2005 building with Windows Mobile 5 SDK for PocketPC (because the device is PocketPC). I think it's native code because it's all written in C++ without using NET Framework. Is there any other way? Do i have to change some settings in VS 2005 to create native version?
Hi Mimispa,
If you're already creating a native version, you may want to create a 2003 version instead. The cause of the problem could be DirectDraw (which is unlikely, but you never know with Microsoft

).
Would you like to install the 2002, 2003 and 2005 versions of the helloworld sample from the EDGELIB SDK? Do they all operate in landscape? If not, which ones do?
Hi Edge,
Yes, that's a good idea. I'll test it in a few hours because i don't have the sample device now!
But, building with earlier versions of SDK (like 2003) it's problem because a lot of things changed at 2005 SDK (like retrieving ID of device).
Another (not good) solution for devices like that is to callibrate the stylus from user input before the application start (like does the PocketPC when it start)
Hi Mimispa,
I think it would be best if you can show me the results of testing the 2002, 2003 and 2005 versions of helloworld and see which ones operate in landscape.
Then we can think of the best solution to solve this issue.
Hi Edge,
Yesterday, I had the device only for 30 minutes and i didn't have time to test older versions (2002,2003), but i had time to test 2005 version of helloworld.
In that version the graphics are in portrait mode, but stylus is in landscape mode. I examine the code and i saw that helloworld use config->resolution = ERS_EMULATELOWRES, so i change that setting in my application. Then i run my application again and i saw a very strange thing. The stylus is in landscape mode and all graphics are in portrait mode, except some gradient graphics (created from GradientRectV function) that are in landscape mode. The question is why GradientRectV function draw with landscape coordinates and other graphic functions draw in Portrait mode? (Maybe i help you with that!)
So, the results with 2005 PocketPC SDK now are:
using ERS_EMULATELOWRES
Graphics-> Portrait Mode (except GradientRectV)
Stylus-> Landscape Mode
using ERS_DEVICEDEFAULT
Graphics-> Landscape Mode
Stylus-> Portrait Mode
I'll have the device today for a couple of hours and i'll test the older versions of helloworld.
I saw that some POCKETPC devices have the ability to change the screen mode (PORTRAIT, LANDSCAPE etc). The first device i test with that ability is IPAQ TRAVEL COMPANION RX5700 PocketPC 2005. My worry is do we have that problem in all pocketpc 2005 with that ability, or that problem is in the specific model?
I'll show you the results of older versions.
Thanks for your help!
Hi Mimispa,
We're testing with the Dell Axim x50v and MDA pro (both have Windows Mobile 5 installed). They all work correctly, including screen orientation and stylus coordinates.
We also test rotating the screen using a button on the Axim, and a screen flip on the MDA pro. Both work correctly as well.
I think DirectDraw is broken on the device, because ERS_EMULATELOWRES ignores DirectDraw and uses GAPI instead. It could also be that the screen is actually natively landscape (I would guess that they pasted a landscape screen rotated on the device to make it look portrait :p). Maybe you can check for updated firmware to see if there is a fix.
Hi Edge,
I've tested the device with version (POCKETPC 2003 SDK) and the results are same as (POCKETPC 2005 SDK).
Yesterday i was wrong about Stylus using ERS_EMULATELOWRES. I found that Stylus is ok using ERS_EMULATELOWRES (sorry about my mistake). But the GradientRectV still works in Landscape mode.
So the results with 2003 SDK, 2005 SDK are:
using ERS_EMULATELOWRES
Graphics-> Portrait Mode (except GradientRectV)
Stylus-> Portrait Mode
using ERS_DEVICEDEFAULT
Graphics-> Landscape Mode
Stylus-> Portrait Mode
What are the disavantages of using GAPI (ERS_EMULATELOWRES) compare using DIRECTDRAW (ERS_DEVICEDEFAULT)? (Because if i use the first maybe works with all devices)
Hi Mimispa,
Compared to DirectDraw, GAPI may be deprecated soon. However, there have been discussions about this for several years now, but most devices still work with GAPI. Another disadvantage is that GAPI doesn't allow native high-resolution support (graphics will be stretched to fit on the VGA screen).
GradientRectV doesn't seem to react to a different screen orientation. I think the screen of the device is native landscape. Would you like to test other applications to see if the stylus control works correctly?
Hi Edge,
Other applications works correctly, but they use GDI graphics routines.
For the GradientRectV routine, if i use FillRect then it works correctly but if i use GradientRect then it works in Landscape Mode (with the same rectangle as input).
I read the topic of MetsDuManche and i think it's the same problem with coordinates.
You are right, the device is native landscape (if you see it all hardware buttons with hardware screen are in Landscape shape) and maybe that's the reason why GetSystemRotation returns 0.
Maybe the default for Software (ROT_NONE) is PROTRAIT mode but the defaut for some devices hardware (ROT_NONE) is LANDSCAPE mode (I don't know if that's true, it's only a theory).
Thanks!
Hi Mimispa,
I think the screen layout of your device is indeed landscape. That's why it starts in landscape orientation by default (and GetRotation returns 0). So all is well.
The only problem is that stylus coordinates are portrait, which I don't understand. You would think that with a device that's meant to be used as landscape, it would return the coordinates as landscape.
With MetsDuManche the problem seems to be the other way around. The HTC P3600 looks like a portrait device, but returns stylus coordinates in landscape.
Hi Edge,
I agree that the device default hardware is Landscape, but now setting of device (from system settings of wince) is PORTRAIT mode. So all other applications run in PORTRAIT mode.
I think that Stylus works well giving coordinates in portrait mode. The problem is with the draw functions drawing in Landscape mode.
Maybe something wrong with the specific model, I don't know!

Hi Mimispa,
The EDGELIB framework always takes the default display configuration (which is landscape for your device).
To change this behaviour (and let it use the orientation of Windows Mobile), use ROT_AUTO in EDGECONFIG::rotation.