using SharpDX in Metro to do Image-Processing

3

I'm working on SharpDX to do image processing on Metro. Now I successfully get the data in WICBitmap, and copy it to WriteableBitmap to show the image in Image Control. But now the problem is, I need to put the data from a WriteableBitmap(not from a file, the image data is instantaneously generated) into a D2D Bitmap, so I write the codeļ¼š

DataStream originalDataStream = new DataStream(Height * Width * 4, true, true);
originalWriteableBitmap.PixelBuffer.AsStream().CopyTo(originalDataStream);
WICStream oriWICStream = new WICStream(wicFactory, originalDataStream);

SharpDX.WIC.BitmapDecoder bitmapDecoder = new SharpDX.WIC.BitmapDecoder(wicFactory, oriWICStream, DecodeOptions.CacheOnLoad);

When I run the code, the error occured in the last line: HRESULT: [0x88982F50], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: The component cannot be found.

Who knows how to solve this problem? Thanks!!!

PS: you can download my test project here: http://sharpdx.org/forum/5-api-usage/297-wic-d2d1-using-sharpdx-in-metro-to-do-image-processing#297

image-processing
microsoft-metro
sharpdx
asked on Stack Overflow Jun 24, 2012 by Han • edited Jun 24, 2012 by Han

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0