Results 1 to 3 of 3

Thread: Old Style Printer.hDC

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    4

    Old Style Printer.hDC

    Hi All,
    I need to print the contents of a 3rd Party imaging control. In vb6 I could do this -

    myControl.prnHDC = Printer.hDC
    myControl.PrintImage
    Printer.EndDoc

    Any ideas how I can do this in .NET.

    The .NET SDK tells me the old Printer.HDC property is no longer needed because the PrintDocument class is a device context itself.

    I can't seem to find a way to hook the image data to the Graphics object either. If I do this -

    myControl.hDC = e.Graphics.GetHDC

    The IDE tells me it cannot convert a System.IntStr to an Integer. All of myControl's hdc properties are Integers.

    Any help is greatly appreciated.

    TIA

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    I think you mean IntPtr and not IntStr. You must have Option Strict On, which is a good thing though. This means you must explicitly convert the IntPtr to an integer, because implicit conversions are not allowed.
    Try someting like this:
    myControl.hDC = e.Graphics.GetHDC.ToInt32

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    4
    Yes..I meant IntPtr (as you pointed out)

    I'll give your advice a try.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width