Screen orientation change causes exception!
| Tue, 2006-04-04 09:50 | |
|
Here is my code for deal with screen rotation:
TPixelsAndRotation iLandscape; TSize iMySize(302,208); iLandscape.iPixelSize=iMySize; iLandscape.iRotation=CFbsBitGc::EGraphicsOrientationNormal; (static_cast<CWsScreenDevice*>(iBackBufferGc->Device()))->SetScreenSizeAndRotation(iLandscape); But it causes exception on last operator... Is anybody know, how to deal with CWsScreenDevice correctly ? Thanks in advance!!! |
|






Forum posts: 364
iBackBufferGc have a valid value and does iBackBufferGc->Device() return a non null pointer?
Forum posts: 17
Unfortunately in UIq 2.1 IMPOSSIBLE to rotate screen with API functions. Screen device is not able to rotate! We can rotate bitmaps only... by ourself...
Forum posts: 2009
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Forum posts: 13
i has the same problem: with hardware screen rotating, but my situation has that difference: my code does't crash, but calling this method not give my any result (screen rotate stay as default) here is my code:
iWsSession = new RWsSession;
iWsSession->Connect();
iWsScreenDevice = new(ELeave)CWsScreenDevice(*iWsSession);
iWsScreenDevice->Construct();
iFbsScreenDevice = CFbsScreenDevice::NewL(_L("Elecard Video Renderer"), iWsScreenDevice->DisplayMode());
TInt aMode = iWsScreenDevice->CurrentScreenMode();
TPixelsAndRotation aScreenMode, aScreenMode2;
iWsScreenDevice->GetScreenModeSizeAndRotation(aMode, aScreenMode);
aScreenMode2.iPixelSize.iWidth = aScreenMode.iPixelSize.iHeight;
aScreenMode2.iPixelSize.iHeight = aScreenMode.iPixelSize.iWidth;
if (aScreenMode.iRotation == CFbsBitGc::EGraphicsOrientationNormal)
aScreenMode2.iRotation = CFbsBitGc::EGraphicsOrientationRotated270;
iWsScreenDevice->SetCurrentRotations(aMode, CFbsBitGc::EGraphicsOrientationRotated270);
iWsScreenDevice->SetScreenSizeAndRotation(aScreenMode2);
iFbsBitGc = CFbsBitGc::NewL();
iFbsBitGc->SetOrientation(CFbsBitGc::EGraphicsOrientationRotated270);
iFbsScreenDevice->CreateContext((CGraphicsContext*&)iFbsBitGc);
iFbsScreenDevice->SetAutoUpdate(ETrue);
iFbsBitGc->Activate(iFbsScreenDevice);
iFbsBitGc->Reset();
iWsSession->Flush();
--
Wbr, Yuri
--
Wbr, Yuri