Guest User

Untitled

a guest
Jun 4th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. if (face == null)
  2. {
  3. throw new ArgumentNullException("Brak Bazy!");
  4. }
  5.  
  6. if (hair == null)
  7. {
  8. throw new ArgumentNullException("Oczy nie zostały wybrane!");
  9. }
  10.  
  11. Bitmap outputImage = new Bitmap(this.pictureBox1.Width, this.pictureBox1.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
  12.  
  13. using (Graphics graphics = Graphics.FromImage(outputImage))
  14. {
  15. graphics.DrawImage(this.pictureBox1.Image, new Rectangle(new Point(), face.Size),
  16. new Rectangle(new Point(), face.Size), GraphicsUnit.Pixel);
  17. graphics.DrawImage(hair, new Rectangle(new Point(0, face.Height + 1), hair.Size),
  18. new Rectangle(new Point(), hair.Size), GraphicsUnit.Pixel);
  19. }
  20. pictureBox2.Image = outputImage;
  21. pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
Advertisement
Add Comment
Please, Sign In to add comment