473,657 Members | 2,394 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c# Windows Application Printing Graphics

147 New Member
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

Expand|Select|Wrap|Line Numbers
  1. 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
Expand|Select|Wrap|Line Numbers
  1. writer.WriteLine(System.Drawing.Image.FromFile(@"\\Server\\idc 
  2. decipher\\Resources\\S05.jpg"));
The paper in the printer just runs through without printing.

Any ideas what I should be doing?

Thanks

Dave
Jun 11 '08 #1
2 1679
Plater
7,872 Recognized Expert Expert
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?
Jun 11 '08 #2
Curtis Rutland
3,256 Recognized Expert Specialist
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.
Jun 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2152
by: Mr. B | last post by:
This is driving me NUTZ!!! I've been screwing around on this for a week now. And I have tried to find examples similar to what I have (nada). Got lots of streaming a TXT file... bah! I am really stuck here (probably the ol' Not seeing the tree cause of the forest thingy). But I just can not get this to work. The following is my Test example code. Just needs a Button1 on a blank Form. Add in PrintDocument1, PrintPreviewDialog1,...
5
3467
by: VMI | last post by:
I have a BMP image (the form is also in PDF) that contains a scanned copy of a paper form that we need to fill out. Is it possible to use this image in my application so that the application can print out the form and the data that the user entered? For example, the user loads the application and a normal Windows Form asks for the user's name. When the user enters the name and clicks on the "Print" button, I'd like to print the form in the...
0
1047
by: nest | last post by:
Im compiling on xp box but need to deploy on 98SE box. Application works great except printing, after i try to print on 98SE box it freezes completly. Code is quite standard: private void printDocument1_PrintPage(object sender, PrintPageEventArgs e) while ( trenutniVirman < iBrojac ) { e.Graphics.DrawString(arrayMatrica, new Font("Times New Roman", 8 ),
4
9251
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And this differences increases with the increase number of labels. The code is as follwods: Here rdr = OleDbDataReader Font is Times New Roman, 12pt
0
1823
by: Nigel | last post by:
I successfully create a .NET Component (Visual Basic .NET) that would print, unfortunately when used within a web browser it appears that .NET security doesn't allow you to run code that interacts with the file system (including printing) from the web browser. How do I disabled this so I can get my windows form control to work within IE? Also, do any have any printing code or know how I can implement multipage printing using the...
1
5704
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me to use the above controls, example 1. The bottom two subroutines will print a graphic file, example...
6
3241
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument (much like the current model), but my PrintDocument would have a Pages collection such that each time you need to have an additional page, you would just add another page to the collection and then use the page object for the actual drawing etc. ...
0
1508
by: developer200701 | last post by:
The following code (which is distilled down from a larger application) worked for several years previously. Now, the instant you click on the print icon within the print preview window the workstation crashes hard: reboots and upon Windows restart wants to send an error report to Microsoft (recovered from severe error). My default printer is HP LaserJet 5000N Series PCL6; if I select an alternative printer (different HP model) this...
0
1381
by: rafiki31 | last post by:
I have been hitting walls trying to find the right way to print from a web application. Here is the thing, im implementing a webapplication for a kiosk. The kiosk has its own card printer. When i tested the application using my pc as a server everything worked perfectly. Of course this is because i hadnt realize that the server was the one sending the print promtp to the printer which was ALSO connected to my printer so when i published the...
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.