C++/VB - Performance of ID21RenderTarget::CreateBitmapFromWicBitmap

Asked By docschnipp
30-Oct-09 06:18 PM
I am porting my cross platform "Graphics" class to Direct2D.
Unfortunately, in opposite to all other render engines out there, bitmaps I
can use to draw them must be created from a factory. The library design
actually has a global pool of bitmaps that can be used, but unfortunately I
do not have a render target during the loading of the bitmaps.

So my question is:
- Is ID21RenderTarget::CreateBitmapFromWicBitmap fast enough so I can keep
the WicBitmaps in the pool (already converted to
GUID_WICPixelFormat32bppPBGRA )
- Should I create a bitmap based 32bppPBGRA Rendertarget and use it to load
the bitmaps?
- Can I easily use such a bitmap created by RenderTarget A and draw them
with RenderTarget B (like a ID2D1DCRenderTarget)?

In GDI+ I can just use GDI+ bitmaps and they are not tight to a GDI+
Graphics object.

Thanks for any input on that issue,

doc
ID2D1DCRenderTarget
(1)
CreateBitmapFromWicBitmap
(1)
ID21RenderTarget
(1)
SolidColorBrush
(1)
WicBitmaps
(1)
EndDraw
(1)
Rendertarget
(1)
Graphics
(1)
  docschnipp replied to docschnipp
01-Nov-09 10:19 AM
Hi,

I want to add some more information to my post:



I mimiced the demo app behaviour and pool WICBitmaps now. When needed, I
create D2DBitmaps of it, but keep them in a cache associated with my
RenderTarget. The Cache gets cleared, when EndDraw() returns
D2DERR_RECREATE_TARGET or the RenderTarget gets destroyed by any reason.

So, questions:
-Is this the most suitable way for an implementation?
-What will be the typical limit for such an implementation (in terms of
memory used by the D2D-Bitmaps)?


should have read "tied".

I have an additional question:

-Will there be a massive performance hit when I do not cache SolidColorBrush
objects?

Thanks again,
doc
Create New Account
help
mail reply addres should have all d's replaced with l's- Win32 GDI Discussions ID2D1DCRenderTarget (1) BindDC (1) APIs (1) PDFs (1) DirectStuff (1) DirectWrite (1) DirectX (1) Placements (1) Please ignore, the ID2D1DCRenderTarget object allows me to use Direct2D drawing on a GDI printing context. (I missed this the same HDC, but if the DC corresponds to a printer, the BindDC method of ID2D1DCRenderTarget fails with E_INVALIDARG. Does the ID2D1DCRenderTarget need to created in a different way for printing, or what else could be wrong