⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multimediafappview.cpp

📁 一个详细记录symbian媒体播放的源代码
💻 CPP
字号:
/**
 *
 * @brief Definition of CMultiMediaFAppView
 *
 * Copyright (c) EMCC Software Ltd 2003
 * @version 1.0
 */

// INCLUDES

//  Class include
#include "MultiMediaFAppView.h"

// System includes
#include <eikenv.h> // CEikonEnv

// User include
#include "ImageModel.h"

// CONSTANTS


// ================= MEMBER FUNCTIONS =======================

/**
 * Symbian OS 2 phase constructor.
 * Constructs the CMultiMediaFAppView using the NewLC method, popping
 * the constructed object from the CleanupStack before returning it.
 *
 * @param aRect The rectangle for this window
 * @return The newly constructed CMultiMediaFAppView
 */
CMultiMediaFAppView* CMultiMediaFAppView::NewL(const TRect& aRect, MImageModel& aImageModel)
    {
    CMultiMediaFAppView* self = CMultiMediaFAppView::NewLC(aRect, aImageModel);
    CleanupStack::Pop(self);
    return self;
    }

/**
 * Symbian OS 2 phase constructor.
 * Constructs the CMultiMediaFAppView using the constructor and ConstructL
 * method, leaving the constructed object on the CleanupStack before returning it.
 *
 * @param aRect The rectangle for this window
 * @return The newly constructed CMultiMediaFAppView
 */
CMultiMediaFAppView* CMultiMediaFAppView::NewLC(const TRect& aRect, MImageModel& aImageModel)
	{
	CMultiMediaFAppView* self = new (ELeave) CMultiMediaFAppView(aImageModel);
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}

/**
 * Symbian OS 2nd phase constructor.  Creates a Window for the controls, which it contains.
 * Constructs a label and adds it to the window, which it then activates.
 * @param aRect The rectangle for this window
 */
void CMultiMediaFAppView::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    SetRect(aRect);
    ActivateL();
    }

/**
 * Destructor.
 */
CMultiMediaFAppView::~CMultiMediaFAppView()
    {
    }

/**
 * C++ Constructor. Sets the image model reference
 *
 * @param aImageModel The image model used to get image to display
 */
CMultiMediaFAppView::CMultiMediaFAppView(MImageModel& aImageModel) :
        iImageModel(aImageModel)
    {
    }

/**
* Draw function
*
* @param aRect The rectangular area to draw to
*/
void CMultiMediaFAppView::Draw(const TRect& /*aRect*/) const
    {
    CWindowGc& gc = SystemGc();
	TRect clientRect = Rect();
    gc.Clear(clientRect);
    CFbsBitmap* bitmap = &(iImageModel.Image());
    TSize bitmapSize = bitmap->SizeInPixels();
    TInt topLeftX = (clientRect.Width() - bitmapSize.iWidth) / 2;
    TInt topLeftY = (clientRect.Height() - bitmapSize.iHeight) / 2;
    gc.BitBlt(TPoint(topLeftX, topLeftY), bitmap);
	}

/**
 * Redraws the AppView using the newly converted image obtained through
 * MImageModel
 */
void CMultiMediaFAppView::RedrawAppView() const
    {
    DrawNow();
    }

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -