×
Namespaces

Variants
Actions

在应用程序中内置一个摄像头的视图(view)

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台: S60 1st Edition, S60 2nd Edition
S60 2nd Edition (initial release)
S60 1st Edition

文章
翻译:
huwell
最后由 hamishwillee 在 16 Aug 2012 编辑
  • 详细描述

我怎样可以像我的程序中添加一个内置式的 摄像头的视图(view)呢?比如在'信息'程序 中,选项->添加->新图象,这样的功能。 概况


下面的代码演示了如何在一个应用程序中内 置一个摄像头程序。包括启动摄像头的函数, MApaEmbeddedDocObserver::NotifyExit() 这一函数也要对其进行实现,以便用户退出 时做出响应。

void MyApplication::NewImage()
{
const TUid KUidCamera = { 0x1000593F };
 
RApaLsSession apaLs;
 
TApaAppInfo appInfo;
 
CApaDocument* doc = NULL;
 
CEikProcess* process = CEikonEnv::Static()->Process();
 
User::LeaveIfError(apaLs.Connect());
 
CleanupClosePushL(apaLs);
 
User::LeaveIfError(apaLs.GetAppInfo(appInfo, KUidCamera));
 
doc = process->AddNewDocumentL(appInfo.iCaption, KUidCamera);
 
CleanupStack::PopAndDestroy(); // apaLs
 
TApaDocCleanupItem cleanup(process, doc);
 
CleanupStack::PushL(cleanup);
 
doc->NewDocumentL();
 
CleanupStack::Pop(); // cleanup
 
doc->EditL(this, ETrue);
}
 
void MyApplication::NotifyExit(TExitMode aMode)
{
// camera view has been closed
}
This page was last modified on 16 August 2012, at 09:18.
55 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×