Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
480 views
in Technique[技术] by (71.8m points)

c# - How to merge two images into a single Jpeg

I need to be able to take multiple images and overlay a smaller one on top of a larger one and save the result as a single image. How would I go about accomplishing this in C#?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. Load the first image using new Bitmap(filename)
  2. Load the second image the same way.
  3. Get a Graphics object by calling Graphics.FromImage(bitmap1)
  4. Call graphics.DrawImage(bitmap2...) to put the second image on the first
  5. Call bitmap1.Save(...) to save the new image to a file.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...