RenderTargetBitmap bmp = GetBitmap();// copy into a byte array
int stride = bmp.PixelWidth * 4;
byte[] data = new byte[bmp.PixelHeight * stride];
bmp.CopyPixels(data, stride, 0); // create texture
using (MemoryStream ms = new MemoryStream(data))
{
ms.Seek(0, SeekOrigin.Begin);
if (dxDevice != null)
{
// next line throws D3DXERR_INVALIDDATA exception
texture = TextureLoader.FromStream(dxDevice, ms);
}
}
Prasoon Pankaj
Member Since 16 Sep 2010Offline Last Active Jan 14 2012 04:04 AM

Find content
Not Telling