亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? camtimer.cpp

?? symbian s60 2nd下的手機定時拍照
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*

        CamTimer.CPP - source file for CamTimer application, Series 60
        C++ implementation

History:
Version 1.10, October 17th 2002
Added features: Snap sound, Launching Photo album from menu for 
				further use of the picture 
				and an updated pkg file for Series 60

Version 1.0, December 1st 2001
CamTimer Released in Forum Nokia

*/


//  Include Files
#include <e32base.h>			// for the CleanupStack
#include <aknapp.h>             // for CAknApplication
#include <akndoc.h>             // for CAknDocument
#include <aknviewappui.h>		// for CAknViewAppUi
#include <aknview.h>            // for CAknView
#include <eikenv.h>				// for CEikonEnv - "Eikon Environment"
#include <akndialog.h>			// for the dialog
#include <eikmfne.h>			// for CEikNumberEditor
#include <CameraServ.h>			// for RCameraServ
#include <MdaImageConverter.h>  // for MMdaImageUtilObserver
#include <f32file.h>			// for handling files
#include <aknsoundsystem.h>		// for playing keysounds - snap

#include "CamTimer.h"			// own header
#include "CamTimer.hrh"			// own enumerations
#include <CamTimer.rsg>			// own resources


// Constants
// CamTimer application UID
const TUid KUidCamTimerApp = { 0x101F5462 };
// UID of CamTimer view
const TUid KCamTimerViewId = { 1 };
// Quality factor for JPG saving
const TInt KJpgSavingQualityFactor = 55;           
// Initial value for waiting time.
const TInt KInitialValue=10;   
// UID of Photo album application
const TUid KPhotoAlbumUid = { 0x101F4CD1 };


_LIT(KWelcomeText,"Welcome");
_LIT(KWelcomeText1,"to");
_LIT(KWelcomeText2,"CamTimer");
_LIT(KThumbnailFilename, "C:\\Nokia\\Images_tn\\CamTimerPicture.jpg");
_LIT(KCamTimerFilename, "C:\\Nokia\\Images\\CamTimerPicture.jpg");

// Definitions
#define KSnapSoundId 2

//
// CCamTimerContainer 
// This container does not have any controls in it, it is only used 
// to draw an image.
//

/*
-------------------------------------------------------------------------------

    ConstructL();

    Description: 2nd phase Constructor.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerContainer::ConstructL(CCamTimerFormView& aFormView)
    {
    iBmp = new (ELeave) CFbsBitmap;
	// take a handle to the object owninf this container
    iFormView = &aFormView;
	// flag: image ready to be drawn or not
    iImageReady = EFalse;    
	// Construct self
    ConstructContainerControlL();
    }


/*
-------------------------------------------------------------------------------

    ~CCamTimerContainer();

    Description: Destructor.

    Return value: N/A

-------------------------------------------------------------------------------
*/
CCamTimerContainer::~CCamTimerContainer()
    {
    delete iBmp;
    iFormView = NULL;
    }


/*
-------------------------------------------------------------------------------

    ConstructContainerControlL();

    Description: Constructing container control

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerContainer::ConstructContainerControlL()
    {
	// Makes the control window owning
    CreateWindowL(); 
    }


/*
-------------------------------------------------------------------------------

    Draw();

    Description: This function draws the application view on the screen.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerContainer::Draw(const TRect& /*aRect*/) const
    {
	// Get the graphics context in which to draw.
    CGraphicsContext& gc=SystemGc();
    
    if(iImageReady)
        {
		// draw our picture
        gc.DrawBitmap( Rect(), iBmp);
		// Draw a rectangle.
        gc.DrawRect(Rect());     
        }
    else
        {
        // no image to draw, draw a text saying "Welcome to CamTimer" 
		// to inform user on behaviour of the directional button

        // Draw white background
        gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
        gc.SetBrushColor(KRgbWhite);
        gc.DrawRect(Rect());

        // Draw black outline
        gc.SetBrushStyle(CGraphicsContext::ENullBrush);
        gc.SetBrushColor(KRgbBlack);
        gc.DrawRect(Rect());
         
        // Draw text "Welcome to CamTimer"
        gc.SetPenColor(KRgbBlack); 
        const CFont* fontUsed = iEikonEnv->TitleFont();
        gc.UseFont(fontUsed);

		// set text position on screen
        TInt baseline = Rect().Height() - fontUsed->AscentInPixels()*3;
		// margin is zero so that the text will be cenetred
        TInt margin=0; 

        gc.DrawText(KWelcomeText2,Rect(),baseline,CGraphicsContext::ECenter, 
																		margin);
		// set text position on screen
		baseline = Rect().Height() - fontUsed->AscentInPixels()*5; 
		margin=0;
        gc.DrawText(KWelcomeText1,Rect(),baseline,CGraphicsContext::ECenter, 
																		margin);
		// set text position on screen
		baseline = Rect().Height() - fontUsed->AscentInPixels()*7; 
		margin=0;
        gc.DrawText(KWelcomeText,Rect(),baseline,CGraphicsContext::ECenter, 
																		margin);
        
        }
    }


/*
-------------------------------------------------------------------------------

    GetBmp();

    Description: This function returns a pointer to the bitmap.

    Return value: N/A

-------------------------------------------------------------------------------
*/
CFbsBitmap* CCamTimerContainer::GetBmp()
    {
    // this function is used to get the bitmap to take a new picture
    // so reseting the bmp first
    iImageReady = EFalse;
    iBmp->Reset();
    return iBmp;
    }

/*
-------------------------------------------------------------------------------

    GetBmpForSaving();

    Description: This function returns a pointer to the bitmap.

    Return value: N/A

-------------------------------------------------------------------------------
*/
CFbsBitmap* CCamTimerContainer::GetBmpForSaving()
    {
    // this fuction is used to get the current image for saving
    // so no reseting this time
    return iBmp;
    }



//
// CCamTimerFormView
//

/*
-------------------------------------------------------------------------------

    ConstructL();

    Description: Default C++ Constructor.

    Return value: N/A

-------------------------------------------------------------------------------
*/
CCamTimerFormView::CCamTimerFormView(TInt* aValue)	// C++ constructor
    : iWaitingTime(aValue)                          // Initialise data
    {
    }


/*
-------------------------------------------------------------------------------

    ConstructL();

    Description: 2nd phase Constructor.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerFormView::ConstructL()
    {
    // Current image index starts from zero (could used when saving images 
	// (not used at the moment))
    iCurrentImage = 0;
	// flag to tell when the app is saving the image asynchronously 
	// (can't take a new pict when saving) 
    iSavingImage = EFalse;  

    // Initialise a client to the camera server
    iCamserv = new(ELeave) RCameraServ;
    
    // Init a file saver utility
    iFileSaver = CMdaImageBitmapToFileUtility::NewL(*this);
    iFormat = new (ELeave) TMdaJfifClipFormat;

	// Create player for snap sound
    iSoundPlayer = (STATIC_CAST(CAknAppUi*,
									CEikonEnv::Static()->AppUi()))->KeySounds();
    TRAPD(error, iSoundPlayer->AddAppSoundInfoListL( R_CAMERA_SNAP_SOUND ));
    if ( ( error != KErrAlreadyExists ) && ( error != KErrNone) )
        {
        User::LeaveIfError(error);
        }

    }


/*
-------------------------------------------------------------------------------

    ~CCamTimerFormView();

    Description: Destructor.

    Return value: N/A

-------------------------------------------------------------------------------
*/
CCamTimerFormView::~CCamTimerFormView()
    {
    if(iContainer)
        AppUi()->RemoveFromStack(iContainer);

    delete iCamserv;
    delete iFileSaver;
    delete iFormat;
    }

/*
-------------------------------------------------------------------------------

    Id();

    Description: Returns the id of the view object.

    Return value: N/A

-------------------------------------------------------------------------------
*/
TUid CCamTimerFormView::Id() const
    {
    return KCamTimerViewId;
    }


/*
-------------------------------------------------------------------------------

    DoActivateL();

    Description: Activate this view.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerFormView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, 
	 TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/ )
    {
    // Connect to Camera Server
    User::LeaveIfError(iCamserv->Connect());
    
    if (!iContainer) // if container hasn't been created yet, let's create it
        {
        // Then construct the UI components
        iContainer = new(ELeave) CCamTimerContainer;             
		// Construct a view control with a ref. to this CCamTimerFormView
        iContainer->ConstructL(*this);      
        // Sets view control's extent to the space available
        iContainer->SetRect(ClientRect()); 
        }

	// Activate the view control
    iContainer->ActivateL();   
    }


/*
-------------------------------------------------------------------------------

    DoDeactivate();

    Description: Deactivate this view.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerFormView::DoDeactivate()
    {
    if (iContainer)
        {
        delete iContainer;
        iContainer = NULL;
        }

    // Disconnect from Camera server
    if(iCamserv)
        {
        iCamserv->Close();
        }

    }

// ---------------------------------------------------------------------------
// CCamTimerFormView::HandleForegroundEventL(TBool aForeground)
// Can be used to open and close the camera depending on the foreground event
// ---------------------------------------------------------------------------
void CCamTimerFormView::HandleForegroundEventL(TBool /*aForeground*/)
    {
	}

/*
-------------------------------------------------------------------------------

    TimerL();

    Description: Do timing showing a series of preview pictures. 
				 Take picture and save it.
    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerFormView::TimerL()
    {
    if(!iSavingImage)
        {  

        // turn on camera
        TurnCameraOnL();

		// For timing
		TTime begin;
		TTime end;
		TTimeIntervalMicroSeconds fromBeginToEndMicroseconds ;
		fromBeginToEndMicroseconds =0;
		begin.HomeTime();
		TTimeIntervalMicroSeconds maxtime;
		maxtime = *iWaitingTime;
		// Loop preview pictures unti given time has reached.
		while (fromBeginToEndMicroseconds <maxtime)
			{
			// Call TakePictureL() to take a low quality image
			TakePictureL(ERCLow);
			end.HomeTime();
		    fromBeginToEndMicroseconds  = end.MicroSecondsFrom(begin);
			}

		// Finally, take the picture
		TakePictureL();

		// Play the camera snap -sound
	    if ( iSoundPlayer )
		    {
			iSoundPlayer->PlaySound(KSnapSoundId);
			}

		// Save the final picture
		SaveImageL();

		// turn off camera
        TurnCameraOffL();

        }
    }

/*
-------------------------------------------------------------------------------

    TurnCameraOnL();

    Description: Turn on the camera. Turning on the camera takes some time
                 and you can do something meaningful between turning on and
                 taking a picture.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerFormView::TurnCameraOnL()
    {
    // Status variable for async function calls
    TRequestStatus status( KErrNone );

    // Turn camera ON
    iCamserv->TurnCameraOn(status);
    User::WaitForRequest(status);
    if( status.Int() != KErrNone )
        {
        // error while turning ON, closing connection to server
        iCamserv->Close();
        User::Leave(status.Int());
        }
    }

/*
-------------------------------------------------------------------------------

    TurnCameraOffL();

    Description: Turn off the camera. A separate method to ease using
                 TurnCameraOnL() from a location other than from where the 
                 actual picture is taken. 
                 You can also turn camera off straight after taking the picture.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerFormView::TurnCameraOffL()
    {
    // Turn camera OFF
    User::LeaveIfError(iCamserv->TurnCameraOff());
    }

/*
-------------------------------------------------------------------------------

    TakePictureL();

    Description: Take a picture and show it on screen. This function sets up,
                 image quality and lighting settings and then gets one image
                 from the camera server.

    Note:        The camera has been turned ON earlier and it will be turned OFF
                 after returning from this function.

    Return value: N/A

-------------------------------------------------------------------------------
*/
void CCamTimerFormView::TakePictureL(TCamTimerImageQuality aQuality)
    {
    // Check the given image quality and set up quality for camera server
    RCameraServ::TImageQuality imageQuality = RCameraServ::EQualityLow;

    if(aQuality == ERCHigh)     // taking a real picture (no snapshot)
        imageQuality = RCameraServ::EQualityHigh;

    // Get a bmp handle from our container
    CFbsBitmap* bmp = iContainer->GetBmp();
	CleanupStack::PushL(bmp);

    // Set image quality (High = 640x480 16M colors, Low = 160x120 4096 colors)
    User::LeaveIfError(iCamserv->SetImageQuality(imageQuality));

    // Status variable for async function calls
    TRequestStatus status( KErrNone );

    // Get an image
    iCamserv->GetImage( status, *bmp );
    User::WaitForRequest(status);
    if( status.Int() != KErrNone )
        {
        iCamserv->TurnCameraOff();
        iCamserv->Close();
        User::Leave(status.Int());
        }

    // Show the image on screen
    iContainer->iImageReady = ETrue;
    iContainer->DrawNow();

    // clear stack
    CleanupStack::Pop();  // bmp

    // clear local pointer

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费观看视频| 久久久久久久性| 精品99一区二区| 亚洲色图一区二区| 久久精品国产久精国产| 91国内精品野花午夜精品| 亚洲精品一区在线观看| 亚洲一区二区三区四区在线| 日韩一区二区三区视频在线| 日韩理论在线观看| 激情欧美日韩一区二区| 欧美老女人在线| 亚洲黄色免费网站| 成人app网站| 国产亚洲精品中文字幕| 久久国产精品99久久久久久老狼| 精品视频在线视频| 亚洲综合一区在线| 99久久精品免费精品国产| 国产欧美精品一区二区三区四区| 久久精工是国产品牌吗| 91精品国产免费久久综合| 夜色激情一区二区| 91农村精品一区二区在线| 日本一区二区三区久久久久久久久不 | av不卡一区二区三区| 精品sm在线观看| 精品一区二区三区久久| 欧美大胆人体bbbb| 久久精品国产亚洲高清剧情介绍| 日韩一区二区三区免费观看| 三级不卡在线观看| 制服.丝袜.亚洲.另类.中文| 同产精品九九九| 日韩一区二区三区观看| 久久超级碰视频| 26uuu国产在线精品一区二区| 久久精品理论片| 26uuu亚洲婷婷狠狠天堂| 精品亚洲国产成人av制服丝袜| 欧美成人a视频| 国产一本一道久久香蕉| 国产网站一区二区| 波多野结衣视频一区| 国产精品系列在线观看| 国产精品色哟哟网站| 91欧美一区二区| 五月天激情综合| 欧美一二三区在线| 国产精品中文字幕日韩精品| 欧美激情在线观看视频免费| 不卡在线观看av| 亚洲影视在线观看| 日韩色在线观看| 国产成人免费网站| 亚洲乱码国产乱码精品精小说 | 欧美一级片在线观看| 激情小说亚洲一区| 自拍偷在线精品自拍偷无码专区| 欧美色图免费看| 久久av老司机精品网站导航| 久久精品理论片| 国产精品久久久久7777按摩 | 成人h动漫精品一区二| 亚洲欧美日韩中文字幕一区二区三区| 欧美色精品在线视频| 另类欧美日韩国产在线| 国产精品欧美极品| 欧美精品丝袜中出| 国产**成人网毛片九色| 亚洲成人综合视频| 欧美高清在线一区| 欧美一区二区精品在线| caoporen国产精品视频| 日本中文在线一区| 国产精品沙发午睡系列990531| 欧美揉bbbbb揉bbbbb| 国产乱一区二区| 午夜电影一区二区| 亚洲视频在线观看一区| 久久网这里都是精品| 欧美性猛交xxxxxxxx| 国产不卡视频在线观看| 日本亚洲最大的色成网站www| 中文字幕一区不卡| 欧美videofree性高清杂交| 91蜜桃免费观看视频| 国产高清无密码一区二区三区| 五月天久久比比资源色| 亚洲美女一区二区三区| 国产日产精品一区| 精品国产乱码久久久久久闺蜜| 欧美日韩一级大片网址| 99久久精品国产导航| 国产一区欧美日韩| 欧美体内she精高潮| 成人三级伦理片| 国产成人在线视频网址| 久久99久久99| 蜜桃一区二区三区在线观看| 五月激情综合婷婷| 一区二区三区四区在线播放| 一区免费观看视频| 一色屋精品亚洲香蕉网站| 久久久www成人免费毛片麻豆| 日韩欧美国产电影| 91精品在线麻豆| 欧美一区日韩一区| 欧美精品v国产精品v日韩精品 | 国产一区二区中文字幕| 麻豆精品视频在线| 免费观看日韩电影| 日本女优在线视频一区二区| 亚洲成a人片在线不卡一二三区| 一区二区在线电影| 亚洲精品成人悠悠色影视| 亚洲成人福利片| 国产色综合一区| 久久精品无码一区二区三区| 欧美va亚洲va国产综合| 精品乱码亚洲一区二区不卡| 欧美一区二区在线免费观看| 日韩一区二区精品在线观看| 日韩欧美一区在线| 久久综合丝袜日本网| 国产欧美1区2区3区| 国产精品乱人伦中文| 亚洲欧洲99久久| 亚洲影视资源网| 免费观看久久久4p| 国产成人无遮挡在线视频| 高清成人免费视频| 91福利视频网站| 日韩欧美国产综合在线一区二区三区| 日韩三级伦理片妻子的秘密按摩| 久久综合九色综合久久久精品综合 | 国产亚洲欧洲一区高清在线观看| 久久久午夜精品理论片中文字幕| 中文字幕精品综合| 一区二区免费在线| 美国av一区二区| 成人动漫视频在线| 欧洲视频一区二区| 日韩精品在线看片z| 国产精品成人一区二区艾草| 一区二区不卡在线播放| 久久国产精品99精品国产| 成人av资源站| 56国语精品自产拍在线观看| 精品免费国产二区三区| 国产精品蜜臀在线观看| 午夜精品一区二区三区三上悠亚| 久久99精品国产麻豆婷婷| 成+人+亚洲+综合天堂| 在线播放亚洲一区| 国产精品久久久久婷婷二区次| 亚洲午夜久久久久久久久电影院| 国内精品免费**视频| 91免费观看国产| 久久久久久久综合日本| 亚洲一区二区在线免费观看视频| 韩国三级中文字幕hd久久精品| 91成人看片片| 亚洲国产精品激情在线观看| 日韩成人免费在线| www.亚洲激情.com| 精品久久国产字幕高潮| 一区二区理论电影在线观看| 国产成人亚洲综合色影视| 欧美人狂配大交3d怪物一区| 国产精品成人免费| 国产在线视视频有精品| 欧美巨大另类极品videosbest| 中文字幕乱码一区二区免费| 麻豆国产精品视频| 欧美日韩在线观看一区二区 | 在线观看亚洲精品| 国产精品美女一区二区三区| 麻豆精品新av中文字幕| 欧美日韩一本到| 亚洲一区二区高清| 色综合色综合色综合| 欧美韩日一区二区三区四区| 久久99国产精品免费| 欧美一区二区三区在线观看 | 亚洲精品免费看| 成人国产电影网| 国产欧美中文在线| 国产成人av电影在线| 日韩欧美国产系列| 美女视频网站黄色亚洲| 日韩天堂在线观看| 视频一区欧美精品| 制服.丝袜.亚洲.另类.中文| 五月婷婷综合网| 91精品综合久久久久久| 喷水一区二区三区| 欧美成人精品二区三区99精品| 麻豆精品国产传媒mv男同| 精品成人佐山爱一区二区|