i need help
-
hi guys i captured an image ok then i want to repeat this image to three times and the all four images are saved in one file that file in a jpg format my code is
Graphics g1 = pictureBox1.CreateGraphics();
Image MyImage = new Bitmap(pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height, g1); Graphics g2 = Graphics.FromImage(MyImage); IntPtr dc1 = g1.GetHdc(); IntPtr dc2 = g2.GetHdc(); BitBlt(dc2, 0, 0, pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height, dc1, 0, 0, 13369376); MyImage.Clone(); g1.ReleaseHdc(dc1); g2.ReleaseHdc(dc2); MyImage.Save(@"c:\\PrintPage.jpg", ImageFormat.Jpeg);
thanks, Mohamed El-Wehishy
-
hi guys i captured an image ok then i want to repeat this image to three times and the all four images are saved in one file that file in a jpg format my code is
Graphics g1 = pictureBox1.CreateGraphics();
Image MyImage = new Bitmap(pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height, g1); Graphics g2 = Graphics.FromImage(MyImage); IntPtr dc1 = g1.GetHdc(); IntPtr dc2 = g2.GetHdc(); BitBlt(dc2, 0, 0, pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height, dc1, 0, 0, 13369376); MyImage.Clone(); g1.ReleaseHdc(dc1); g2.ReleaseHdc(dc2); MyImage.Save(@"c:\\PrintPage.jpg", ImageFormat.Jpeg);
thanks, Mohamed El-Wehishy
Hi, this is what I would try (not tested), and it doesn't use a PictureBox:
Bitmap bmIn=(Bitmap)Image.FromFile(sourceFile);
Bitmap bmOut=new Bitmap(4*bmIn.Width, bmIn.Height);
Graphics grOut=Graphics.FromImage(bmOut);
for(int i=0; i<4; i++) grOut.DrawImage(bmIn, bmIn.Width*i, 0);
bmOut.Save(destinationFile, ImageFormat.Jpeg);
grOut.Dispose();
bmIn.Dispose();
bmOut.Dispose();:)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
-
Hi, this is what I would try (not tested), and it doesn't use a PictureBox:
Bitmap bmIn=(Bitmap)Image.FromFile(sourceFile);
Bitmap bmOut=new Bitmap(4*bmIn.Width, bmIn.Height);
Graphics grOut=Graphics.FromImage(bmOut);
for(int i=0; i<4; i++) grOut.DrawImage(bmIn, bmIn.Width*i, 0);
bmOut.Save(destinationFile, ImageFormat.Jpeg);
grOut.Dispose();
bmIn.Dispose();
bmOut.Dispose();:)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
thanks very much my friend it is done thanks Mohamed El-Wehishy
-
thanks very much my friend it is done thanks Mohamed El-Wehishy
you're welcome. :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!