Question

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.

Was it helpful?

Solution

I got it, it was too easy to see.

RastImage = rendertT.Bitmap
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top