Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C# Programming

Vote on your favorite hash algorithm here!

C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-06-2006, 08:22 AM
Blaze's Avatar   
Blaze Blaze is offline
Programmer
 
Join Date: Jun 2006
Posts: 117
Credits: 1
Rep Power: 9
Blaze is on a distinguished road
Default Modify a BMP

I'm working on a project where I have to print text over an image. I have this code so far but it doesn't print anything. Not even the image. Can someone take a look at my code and see why it isn't printing antyhing:

Code:
System.Drawing.Image bgimage = System.Drawing.Image.FromFile("c:\\image.bmp");
            Bitmap bmp = new Bitmap(1,1);
            Graphics g = Graphics.FromImage(bmp);

            // Set the color of our object
			Brush br = new SolidBrush(Color.Black);
            Pen pr = new Pen(Color.Black);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 09-08-2006, 08:30 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,508
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

You need a PrintPageEventArgs passed through the function and then do:

Code:
// Draw a picture 
e.Graphics.DrawImage(Image.FromFile("C:\\pic.bmp"), e.Graphics.VisibleClipBounds);
After that you can use pens, brushes, drawlines and the whole thing on the image.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-11-2006, 12:28 PM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Credits: 0
Rep Power: 12
NeedHelp is on a distinguished road
Default

Or you can use

Code:
e.Graphics.DrawImage(Image.FromFile("C:\\pic.bmp"), 0,0,500,500);
Replace 500/500 with your own width and height.
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-11-2006, 04:32 PM
Blaze's Avatar   
Blaze Blaze is offline
Programmer
 
Join Date: Jun 2006
Posts: 117
Credits: 1
Rep Power: 9
Blaze is on a distinguished road
Default

Thank you, that is exactly what I needed. That was the only place I was being held back. I have all my data already crated using code like:

Code:
g.DrawString(m_Parent.shipTo1.Text, m_LargeFont, br, 11, 24);
            g.DrawString(m_Parent.shipTo2.Text, m_LargeFont, br, 11, 41);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
No download but error Jeroen66 ionFiles 11 06-27-2007 07:42 AM
How to modify a program written in .NET 2.0? jackyjack C# Programming 7 03-27-2007 12:26 PM
how do i modify this program to irfath C and C++ 1 03-10-2007 10:05 AM


All times are GMT -5. The time now is 09:17 PM.

Contest Stats

Xav ........ 1455.48
MeTh0Dz|Reb0rn ........ 1089.45
WingedPanther ........ 977.76
marwex89 ........ 962.9
John ........ 914.37
morefood2001 ........ 911.18
Brandon W ........ 823.79
chili5 ........ 312.39
Steve.L ........ 276.28
dcs ........ 253.49

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 84%

Ads