简体   繁体   中英

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.

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;

IXRApplication->CreateObject on MSDN:
http://msdn.microsoft.com/en-us/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

Excerpt from the last link:
We declared two IXRBitmapImagePtr objects but we still haven't initialized them. To create a Silverlight for Windows Embedded object we should use the CreateObject method of the IXRApplication object:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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