1

I want to do the following without using WIC:

  1. Create a Direct2D1 Bitmap and draw something into it.

    BitmapProperties props = new BitmapProperties(new SharpDX.Direct2D1.PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied));
    var renderT = new SharpDX.Direct2D1.BitmapRenderTarget(m_d2dRenderTargetImage, CompatibleRenderTargetOptions.None, new SharpDX.Direct2D1.PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied));
    
    renderT.BeginDraw();
    renderT.Clear(SharpDX.Color.Yellow);
    renderT.EndDraw();
    
  2. Save this Bitmap to a variable.

    RastImage = new SharpDX.Direct2D1.Bitmap(renderT, new Size2(targetWidth, targetHeight), props);
    
  3. Draw this Bitmap into a Direct2D RenderTarget.

    m_d2dRenderTarget = new RenderTarget(m_d2dFactory, surface, rtp);
    

But this does not do anything. Could someone tell me what I'm doing wrong? Does it even work without WIC? Any help is welcome. I have searched a lot but never really found an example without WIC.

4

1 回答 1

1

我明白了,太容易看到了。

RastImage = rendertT.Bitmap
于 2013-11-07T16:20:10.050 回答