Screen Rotaion with IBITMAPROT_GetRotation | developer.brewmp.com Screen Rotaion with IBITMAPROT_GetRotation | developer.brewmp.com

Developer

Screen Rotaion with IBITMAPROT_GetRotation

Forums:

Hi,

I tried a sample application for screen rotation.I found a post in brew forum that it is possible to simulate screen rotation.So for simulating screen rotation i tried the following way. Is it is possible to simulate screen rotation both on device and simulator which have no support of screen rotation.I tested this both on simulator and device which have no support of screen rotation.

In the EVT_APP_START I called the function ISHELL_GetDeviceInfoEx(pMe->a.m_pIShell,AEE_DEVICESTATE_SCR_ORIENTATION, &iValue, &iSize);
But the return value is EUNSUPPORTED , that means API is not supported.I am using Brew SDk3.1.5SP01(Updated Release in march 28, 2008).
I tested this with an emulator which is in landsacpe mode.

For simulating the screen rotation during application start up I send an event to my current application in the following way,

ISHELL_SendEvent(pMe->a.m_pIShell, 0x01009FF0, EVT_SCR_ROTATE,AEE_SO_LANDSCAPE,1);

Then I got the event EVT_SCR_ROTATE in my application.In that event i tried the following code for screen rotation,

int nBefore, nAfter;
char buf[10];
int ret;
IBitmap* pBmp = NULL;
IBitmapRot* pIBitmapRot = NULL;

ret = IDISPLAY_GetDeviceBitmap(pMe->a.m_pIDisplay, &pBmp);

if (SUCCESS != ret)
{
if(pBmp)
IBITMAP_Release(pBmp);
return TRUE;

else
{
ret = IBITMAP_QueryInterface(pBmp, AEEIID_BITMAPROT,&pIBitmapRot);
IBITMAPROT_GetRotation(pIBitmapRot);
STRCPY(buf, "r:90");
IDISPLAY_SetPrefs(pMe->a.m_pIDisplay,buf, STRLEN(buf));
IDISPLAY_Update (pMe->a.m_pIDisplay);
nAfter = IBITMAPROT_GetRotation(pIBitmapRot);

if (nAfter != 90){
DBGPRINTF("Rotation Success");

else { DBGPRINTF("Rotation FAILED");

But After running the above code nothing happend on screen,After calling the function "IBITMAP_QueryInterface(pBmp, AEEIID_BITMAPROT,&pIBitmapRot)", return value is "3 - ECLASSNOTSUPPORT -Specified class unsupported".

For calling the function "IDISPLAY_SetPrefs" I setted a privilege in dependency tab of mif file.The return value of that function is SUCCESS.

If anybody successfully simulated screen rotation help me.

Is it is possible to simulate screen rotation.If yes for simulating screen rotation this is the correct way? if not correct me.Problem is I have no simulator or device with support of screen rotation.

Thanks,
Premlal

I tried in another way like getting device bitmap by calling IDISPLAY_GetDeviceBitmap and created a duplicate bitmap by calling IBITMAP_CreateCompatibleBitmap.
And set display destination to newly created bitmap.(IDISPLAY_SetDestination).
And finally called
STRCPY(buf, "r:90");
IDISPLAY_SetPrefs(pMe->a.m_pIDisplay,buf,sizeof(buf));
IDISPLAY_Update (pMe->a.m_pIDisplay);
But result is same. If any body successfully tesetd screen rotatiion on simulator plz help me

I tried in another way like getting device bitmap by calling IDISPLAY_GetDeviceBitmap and created a duplicate bitmap by calling IBITMAP_CreateCompatibleBitmap.
And set display destination to newly created bitmap.(IDISPLAY_SetDestination).
And finally called
STRCPY(buf, "r:90");
IDISPLAY_SetPrefs(pMe->a.m_pIDisplay,buf,sizeof(buf));
IDISPLAY_Update (pMe->a.m_pIDisplay);
But result is same. If any body successfully tesetd screen rotatiion on simulator plz help me