CFbsBitmap* CMobiStegoChooseImgView::loadImageL() { RFs fs; TRequestStatus status; CFbsBitmap* bitmap = NULL; CImageDecoder* aImageDecoder = NULL; User::LeaveIfError(fs.Connect()); CleanupClosePushL(fs); RFbsSession::Connect(fs); RFbsSession* rfbs = RFbsSession::GetSession(); aImageDecoder = CImageDecoder::FileNewL(fs, _L("c:\\Data\\Images\\red.jpg")); CleanupStack::PushL(aImageDecoder); bitmap = new (ELeave) CFbsBitmap(); CleanupStack::PushL(bitmap); TSize sizeImage = aImageDecoder->FrameInfo().iOverallSizeInPixels; TInt aa = KErrCouldNotConnect;//////INDAGA!!!!!!!!!!!!!!!! TInt ppp = bitmap->Create(sizeImage, aImageDecoder->FrameInfo().iFrameDisplayMode); aImageDecoder->Convert(&status, *bitmap); CleanupStack::Pop(3); return bitmap; /*CImageDecoder* iImageDecoder = CImageDecoder::FileNewL( iFs, aFileName ); // create the destination bitmap result = new (ELeave) CFbsBitmap(); result->Create( iImageDecoder->FrameInfo().iOverallSizeInPixels, iImageDecoder->FrameInfo().iFrameDisplayMode ); // start conversion to bitmap iImageDecoder->Convert( &iStatus, *result ); return result;*/ }
void CTSmallWindowsTest::ComputeSmallWindows() { TReal sqrtWindowsAcross; Math::Sqrt(sqrtWindowsAcross, iFileNames.Count()); iWindowsAcross = sqrtWindowsAcross; RFs fs; TESTNOERRORL(fs.Connect()); CleanupClosePushL(fs); CImageDecoder* decoder = CImageDecoder::FileNewL(fs, iFileNames[0], CImageDecoder::EOptionAlwaysThread); TFrameInfo info = decoder->FrameInfo(); TReal imageAspectRatio = (TReal)info.iOverallSizeInPixels.iWidth/(TReal)info.iOverallSizeInPixels.iHeight; delete decoder; CleanupStack::PopAndDestroy(); // set window size to create required grid iWindowSize.iHeight = iScreenSize.iHeight / iWindowsAcross; iWindowSize.iWidth = iScreenSize.iWidth / iWindowsAcross; TReal windowAspectRatio = (TReal)iWindowSize.iWidth / (TReal)iWindowSize.iHeight; // adjust window size to maintain image aspect ratio if (iWindowSize.iWidth > iWindowSize.iHeight) { iWindowSize.iWidth /= windowAspectRatio / imageAspectRatio; } else { iWindowSize.iHeight *= windowAspectRatio / imageAspectRatio; } // run the test enough frames to see bounce the grid twice if (iScreenSize.iHeight > iScreenSize.iWidth) { iIterationsToTest = KNumberOfBounces * (iScreenSize.iHeight - iWindowSize.iHeight * iWindowsAcross); } else { iIterationsToTest = KNumberOfBounces * (iScreenSize.iWidth - iWindowSize.iWidth * iWindowsAcross); } }