Skip to content

Commit

Permalink
Update Form1.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
adegeo authored Jun 12, 2024
1 parent 16eed58 commit 003ad7f
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ private void Button1_Click(object sender, EventArgs e)
memoryImage = new Bitmap(s.Width, s.Height, myGraphics);
Graphics memoryGraphics = Graphics.FromImage(memoryImage);
memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);

printDocument1.Print();

}
private void PrintDocument1_PrintPage(System.Object sender,
System.Drawing.Printing.PrintPageEventArgs e) =>
e.Graphics.DrawImage(memoryImage, 0, 0);


private void PrintDocument1_PrintPage(
System.Object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(memoryImage, 0, 0);
}
}
}
}

0 comments on commit 003ad7f

Please sign in to comment.