0

I'm trying to understand how does Office 2013 - the part where it draws content to the screen. My findings to far:

  1. Office is creating a Wic based bitmap, using CreateWicBitmapRenderTarget.
  2. Using this Render Target, Office uses various drawing methods. It wraps those calls with BeginDraw/EndDraw as expected.
  3. Office uses DrawGlyphRun method to draw the text of the document on the Wic bitmap (i.e. the This pointer of DrawGlyphRun is the one returned from CreateWicBitmapRenderTarget).

At this point I'm confused how Office continue. So my question is:

What are the various possible ways to copy a Wic based Render Target to the screen?

I'm pretty sure that at the end, Office is using a swap chain (probably craeted with CreateSwapChain on Windows 7 and CreateSwapChainForHwnd on Windows 8). I'm stepping through various "suspicous" functions such as CreateBitmapFromWicBitmap and CreateBitmapFromDxgiSurface) - but I don't understand the complete chain of API calls.

EDIT (answer to MooseBoys): This is NOT a general question for putting pixels on the screen. The pixels are already on one RenderTarget (A render target that was created with CreateWicBitmapRenderTarget, and then has been drawn with BeginDraw/DrawGlyphRun/EndDraw) and I now want to move those pixes to another RenderTarget (a render target on the actual screen). On the GDC world, I would look for something like BitBlt, to move pixels from one hdc to another. I wonder what is the protocol in the D2D world.

Uri London
  • 10,631
  • 5
  • 51
  • 81
  • There's nothing really specific about a decoded WIC bitmap that requires special handling. As a result, your question basically reduces to "What are the various ways to get pixels to the screen?" to which there are many answers. Are you already drawing other content to the screen? If so, sharing your current technique would help narrow things down. – MooseBoys Oct 02 '13 at 20:39
  • Thank you @MooseBoys for your follow up. Please see my EDIT above. – Uri London Oct 07 '13 at 17:47
  • If you're using D2D for rendering, you probably want to use CreateBitmapFromWicBitmap. Once you have that, just use DrawBitmap on your target. This assumes you already have the rest of D2D set up for rendering to the screen. – MooseBoys Oct 07 '13 at 18:34
  • 1
    If you have a swap chain tied to a Window, you could try calling Present(). http://msdn.microsoft.com/en-us/library/windows/desktop/bb174576%28v=vs.85%29.aspx – Andy Jan 28 '14 at 19:29

0 Answers0