c# Windows Application Printing Graphics

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DaveRook
    New Member
    • Jul 2007
    • 147

    c# Windows Application Printing Graphics

    Hi

    I am coding a windows app in C#.

    The user enters a part number, clicks the button and information about the part number is displayed on the page, including text and graphics (pictures of the part number).

    I am trying to print this. I can print everything other than the graphics.

    I don't even know where to start trying to print graphics. I have tried using

    Code:
    e.Graphics.DrawImage(Image.FromFile("C:\\Documents and Settings...location......images\\S05.jpg"));
    and this doesn't work (No overload for method DrawImage takes 1 argument)

    If I try this
    Code:
    writer.WriteLine(System.Drawing.Image.FromFile(@"\\Server\\idc 
    decipher\\Resources\\S05.jpg"));
    The paper in the printer just runs through without printing.

    Any ideas what I should be doing?

    Thanks

    Dave
    Last edited by sicarie; Jun 11 '08, 02:19 PM. Reason: Moved to .NET Forum
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    You really didn't even look at any of that did you?
    "No overload for method DrawImage takes 1 argument"
    DrawImage needs X,Y coordinates and possibly other attributes.
    Why not try correcting your simple errors first, then see what happens?

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      It seems that there are actually 30 overloads for that method. Do you code in Visual Studio? If you do, you should learn to use IntelliSense to your advantage. As soon as you typed the open-parenthesis after the method, the little popup box that suggests code would tell you what parameters that the method can take.



      At that point you can press Up/Down or click the arrows and see all the overloads.

      IntelliSense is a great way to become more familiar with the language.

      Comment

      Working...