This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Display Orientation and Stylus Problem HP pocketpc 2005


Display Orientation and Stylus Problem HP pocketpc 2005

Postby mimispa » Jul 9, 2007 @ 10:59am

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!
mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Postby edge » Jul 9, 2007 @ 2:15pm

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby mimispa » Jul 9, 2007 @ 2:54pm

mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Postby edge » Jul 10, 2007 @ 9:23am

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?
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Hi Edge,

Postby mimispa » Jul 10, 2007 @ 11:05am

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?
mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Postby edge » Jul 10, 2007 @ 11:26am

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?
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby mimispa » Jul 10, 2007 @ 11:44am

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)
mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Postby edge » Jul 11, 2007 @ 9:39am

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.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Hi Edge,

Postby mimispa » Jul 11, 2007 @ 11:07am

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!
mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Postby edge » Jul 11, 2007 @ 8:45pm

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.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby mimispa » Jul 12, 2007 @ 11:02am

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)
mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Postby edge » Jul 12, 2007 @ 2:03pm

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?
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby mimispa » Jul 13, 2007 @ 11:39am

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!
mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Postby edge » Jul 13, 2007 @ 2:37pm

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby mimispa » Jul 13, 2007 @ 3:32pm

mimispa
pm Member
 
Posts: 35
Joined: Sep 18, 2006 @ 11:20am
Location: Greece


Next

Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron