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);
Modify a BMP
Started by Blaze, Sep 06 2006 05:22 AM
3 replies to this topic
#1
Posted 06 September 2006 - 05:22 AM
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:
|
|
|
#2
Guest_Jordan_*
Posted 08 September 2006 - 05:30 AM
Guest_Jordan_*
You need a PrintPageEventArgs passed through the function and then do:
After that you can use pens, brushes, drawlines and the whole thing on the image.
// 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.
#3
Guest_NeedHelp_*
Posted 11 September 2006 - 09:28 AM
Guest_NeedHelp_*
Or you can use
Replace 500/500 with your own width and height.
e.Graphics.DrawImage(Image.FromFile("C:\\pic.bmp"), 0,0,500,500);
Replace 500/500 with your own width and height.
#4
Posted 11 September 2006 - 01:32 PM
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:
g.DrawString(m_Parent.shipTo1.Text, m_LargeFont, br, 11, 24);
g.DrawString(m_Parent.shipTo2.Text, m_LargeFont, br, 11, 41);


Sign In
Create Account


Back to top









