2

Is it possible to use WPF's InteropBitmap together with gdi+ ? Any examples ?

(I need it for 2D drawing, many small objects; I know how to use gdi+ with WriteableBitmap => (see post by Danko) , but after all I've read InteropBitmap should be faster)

fritz

Community
  • 1
  • 1
fritz
  • 115
  • 1
  • 5

1 Answers1

1

I'd avoid using InteropBitmap for the time being and with this kind of task. I don't think the performance increase would be all you're hoping it to be, especially with the memory leak that requires you constantly calling GC.Collect(). If you said you were doing Direct2D instead of GDI+, I would see more of a reason to attempt going this route.

Is the GDI+ 2D drawing you need to do something that can't be ported over to DrawingContext's methods? In my experience, this has been the easiest and fastest route to porting GDI+ stuf to WPF.

JacobJ
  • 3,677
  • 3
  • 28
  • 32
  • 1
    It could be ported, but it's much slower because of may small text items that must be rendered...In the meantime i have found the fastest solution for my scenario: System.Drawing.BufferedGraphics and a WinForms Picturebox on a windowsformshost inside a wpf app. – fritz Feb 16 '11 at 17:29