=?Utf-8?B?cm9kY2hhcg==?=
10/28/2004 4:10:00 PM
It's ok I figured out that the Graphics object must work
on the actual image object passed into the constructor.
Code is below if anyone cares...
private void Form1_Load(object sender, System.EventArgs e)
{
Image bgImage = Image.FromFile(@"porche_bg.jpg");
Graphics g = Graphics.FromImage(bgImage);
Image imgToDraw = Image.FromFile(@"porche.jpg");
g.DrawImage(imgToDraw, 300, 150, imgToDraw.Width,
imgToDraw.Height);
g.Save();
bgImage.Save("porche_modified.jpg");
MessageBox.Show("Done!");
Application.Exit();
}
>-----Original Message-----
>Hi,
>
>Does anyone know how I can draw some images onto a
>background image and then save the image to a file? I
>thought an easy way would be to draw the images onto a
>graphics object using the DrawImageMethod() then save it
>but I can't figure out how to save the graphics object to
>a file.
>
>Bitmap myImg = new Bitmap(@"porche.jpg");
>Graphics g = Graphics.FromImage(curBitmap);
>g.DrawImage(myImg, 0, 0, myImg.Width, myImg.Height);
>
>How can I save this Graphics object to a file?
>
>Thanks,
>Lachlan
>.
>