Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 22nd, 2007, 10:04 PM   #1
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Print an image

*sigh* i can figure out how to print text, but no matter what i do, i can't seem to print an image

csharp Syntax (Toggle Plain Text)
  1. private void PrintReport()
  2. {
  3. PrintDocument pd = new PrintDocument();
  4. PrintDialog pDialog = new PrintDialog();
  5. pDialog.Document = pd;
  6. PrintPreviewDialog prevDialog = new PrintPreviewDialog();
  7. prevDialog.Document = pd;
  8. pd.PrintPage += new PrintPageEventHandler(Inven_Report);
  9. prevDialog.ShowDialog();
  10. if (pDialog.ShowDialog()== DialogResult.OK)
  11. {
  12. pd.Print();
  13. }
  14. }
  15.  
  16. private void Inven_Report(object sender, PrintPageEventArgs e)
  17. {
  18. Graphics g = e.Graphics;
  19. int i = 0;
  20. Font myFont = new Font("Arial", 10);
  21. try
  22. {
  23. do
  24. {
  25. g.DrawString("Sample Output", myFont, Brushes.Black, 10, 10);
  26. i++;
  27.  
  28. } while (i < 10);
  29. myFont.Dispose();
  30. }
  31. catch (Exception ex)
  32. {
  33. MessageBox.Show(ex.Message.ToString());
  34. }
  35.  
  36. }
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old May 22nd, 2007, 11:32 PM   #2
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
What i show in my first post works and prints the text that it says it will, but I dont know how to modify that(if its worth modifying) to make it print what is in a picture box.
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old May 23rd, 2007, 2:45 AM   #3
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
I have hunted through the MSDN forums, and everything that looks promising, turns out to be for VB .Net, not C#. please could someone help me here?
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old May 23rd, 2007, 6:27 AM   #4
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
Go here.

http://www.developerfusion.co.uk/uti...btocsharp.aspx
__________________
People who click "images" that end with .exe shouldn't have computers.
Ghost is offline   Reply With Quote
Old May 23rd, 2007, 6:35 AM   #5
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
Have you tried this?
g.DrawImage(imageRef, new Point(0, 0));
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Old May 23rd, 2007, 5:48 PM   #6
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Quote:
Originally Posted by InfoGeek View Post
Have you tried this?
g.DrawImage(imageRef, new Point(0, 0));
Your my hero
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
error 3 Expected end-of-statement m0rb1d Other Scripting Languages 0 Dec 12th, 2006 10:05 AM
Beginers Python Tutorial Beegie_B Python 15 Jul 28th, 2006 11:43 AM
[Python] BlackJack UnKnown X Show Off Your Open Source Projects 9 Feb 20th, 2006 6:01 AM
First Python Programme: Fibonacci Finder UnKnown X Python 2 Dec 15th, 2005 6:19 PM
ftplib help please! disAbled Python 1 Jun 30th, 2005 8:05 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC