?? cpictureloader.cpp
字號:
/*
*
============================================================================
* Name : CPictureLoader.h
* Part of : Example3D
* Created : 12/14/2003 by Forum Nokia
* Description:
* This is the project specification file for Example3D.
* Initial content was generated by Series 60 AppWizard.
*
* Version : 1.0.0
* Copyright: Forum Nokia
*
============================================================================
*/
// INCLUDES
#include "CPictureLoader.h"
#include <eikenv.h>
#include <eikappui.h>
#include <eikapp.h>
// MEMBER FUNCTIONS
CPictureLoader* CPictureLoader::NewL()
{
CPictureLoader* self = new( ELeave )CPictureLoader();
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop( self );
return self;
}
CPictureLoader::~CPictureLoader()
{
}
void CPictureLoader::ConstructL()
{
TFileName appFullName = CEikonEnv::Static()->EikAppUi()->Application()->AppFullName();
TParse parse;
//On WINS the application is on the z drive
#ifdef __WINS__
parse.Set(_L("c:"), &appFullName, NULL);
#else
parse.Set( appFullName, NULL, NULL);
#endif
iPath = parse.DriveAndPath();
}
CPictureLoader::CPictureLoader()
{
}
TBitmap CPictureLoader::LoadL( const TFileName& aFileName, TDisplayMode aDisplayMode )
{
TFileName file( iPath );
file.Append( aFileName );
CFbsBitmap bitmap;
iStatus = KErrNone;
CMdaImageFileToBitmapUtility* util;
util = CMdaImageFileToBitmapUtility::NewL( *this ) ;
CleanupStack::PushL( util );
util->OpenL( file );
CActiveScheduler::Start();
User::LeaveIfError( iStatus );
TFrameInfo frameInfo;
util->FrameInfo( 0, frameInfo );
User::LeaveIfError( bitmap.Create( frameInfo.iOverallSizeInPixels, aDisplayMode ) );
util->ConvertL( bitmap );
CActiveScheduler::Start();
User::LeaveIfError( iStatus );
CleanupStack::PopAndDestroy( util );
TBitmap bm;
bm.iSize = bitmap.SizeInPixels();
TInt pixels = bm.iSize.iWidth * bm.iSize.iHeight;
bm.iData = new( ELeave )TUint16[ pixels ];
TInt y;
for( y=0; y<bm.iSize.iHeight; y++ )
{
TPtr8 ydata( ((TUint8*)bm.iData) + y * bm.iSize.iWidth * 2, bm.iSize.iWidth * 2 );
bitmap.GetScanLine( ydata, TPoint( 0, y ), bm.iSize.iWidth, aDisplayMode );
}
return bm;
}
void CPictureLoader::MiuoConvertComplete( TInt aError )
{
iStatus = aError;
CActiveScheduler::Stop();
}
void CPictureLoader::MiuoCreateComplete( TInt /*aError*/ )
{
// manual create...
}
void CPictureLoader::MiuoOpenComplete( TInt aError )
{
iStatus = aError;
CActiveScheduler::Stop();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -