jingwood / d2dlib

A .NET library for hardware-accelerated, high performance, immediate mode rendering via Direct2D.
MIT License
234 stars 40 forks source link

Printing output #109

Open FraserElectronics opened 1 year ago

FraserElectronics commented 1 year ago

Is it possible to print rendered graphics? I can use CreateBitmapGraphics to get the rendered output into a bitmap but how to I then get that bitmap into a GDI bitmap that I can send to the printer?

Any help would be appreciated.

Andy

agfp commented 11 months ago

D2D.CreateBitmapGraphics(...), creates an hardware optimized ID2D1Bitmap and, AFAIK, you can't print it.

You need to create a new renderTarget using the imageFactory, and then you'll be able to save, print and share with .NET the created bitmap.

FraserElectronics commented 11 months ago

@agfp Thanks, I will look into it.

Andy