How to deal with handle of DC with C#?

  • Thread starter Thread starter Toru Osm
  • Start date Start date
T

Toru Osm

I'm trying to make an application for printing
using handle of DC with C#.

I know Graphics.GetHdc() and Graphics.FromHdc()
are not supported in a .net compact framework
and there are some SDK like fieldsoftware.

Is there any way to get and set handle of DC?

Thanks,

Toru Osm
 
Hi Toru

you can get a DC for printing from either ::CreateDC or ::PrintDlg API
calls - in fact all your printing will have to be done using API wrappers
I use ::PrintDlg as it allows me to select which printer to use and how I
wish to communicate with it COM or IRDA however I did use ::CreateDC
when I first started my printing on the PPC voyage

Shaun
 
Hi Shaun

Thank you for advice!

To tell the truth, actually I'm using API to deal with DC.

I think standard Graphics class's method in CF can not
deal with DC's handle besides windows' handle.

If it is true, I have to change almost of Graphic Class's
methods to get/set DC'handle manually for the purpose of
implementing printing.

I hope to change windows' handle to DC's handle and use
standard Graphics class's method.

Toru
 
Back
Top