简体   繁体   English

如何在Silverlight中显示DIB用于嵌入式应用程序?

[英]how to show DIB in silverlight for embedded application?

I am new to silverlight, I'm working on a wince 6 camera application and I want use silverlight embedded as GUI, the data from camera is DIB format, so I test code like below, but the IXRBitmapImage is abstract class, can't be instantiated. 我是Silverlight的新手,我正在使用Wince 6摄影机应用程序,我想使用Silverlight嵌入为GUI,摄影机中的数据为DIB格式,所以我测试如下代码,但是IXRBitmapImage是抽象类,不能被实例化。

IXRImagePtr image;
IXRBitmapImagePtr source = new IXRBitmapImage();
if (FAILED(retcode=root->FindName(TEXT("MyImage"), &image)))
return -1;

source->SetBitmapSource(SHLoadDIBitmap(TEXT("/NandFlash/images/test.bmp")));
image->SetSource(source);

IXMBitmapImagePtr are initialized through IXRApplication->CreateObject(REFIID riid, IXRDependencyObject** ppObject) = 0; IXMBitmapImagePtr通过IXRApplication->CreateObject(REFIID riid, IXRDependencyObject** ppObject) = 0;初始化IXRApplication->CreateObject(REFIID riid, IXRDependencyObject** ppObject) = 0;

IXRApplication->CreateObject on MSDN: MSDN上的IXRApplication-> CreateObject:
http://msdn.microsoft.com/en-us/library/ee503673%28v=winembedded.60%29.aspx http://msdn.microsoft.com/zh-cn/library/ee503673%28v=winembedded.60%29.aspx

For a tutorial: 对于教程:
http://geekswithblogs.net/WindowsEmbeddedCookbook/archive/2009/11/18/silverlight-for-windows-embedded-tutorial-step-3.aspx http://geekswithblogs.net/WindowsEmbeddedCookbook/archive/2009/11/18/silverlight-for-windows-embedded-tutorial-step-3.aspx

Excerpt from the last link: 摘自最后一个链接:
We declared two IXRBitmapImagePtr objects but we still haven't initialized them. 我们声明了两个IXRBitmapImagePtr对象,但是还没有初始化它们。 To create a Silverlight for Windows Embedded object we should use the CreateObject method of the IXRApplication object: 要为Windows Embedded对象创建Silverlight,我们应该使用IXRApplication对象的CreateObject方法:

    if (FAILED(retcode=app->CreateObject(IID_IXRBitmapImage,&img01)))
          return retcode;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM