如何两个图像合并成一个单一的Jpeg [英] How to merge two images into a single Jpeg

查看:148
本文介绍了如何两个图像合并成一个单一的Jpeg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够采取的多个图像和叠加上的一个较大的一个顶部的较小的一个,并将结果保存为单个图像。
我怎么会去用C#实现这个?


解决方案

  1. 加载首个图像使用新位图(文件名)

  2. 加载第二图像相同的方式。

  3. 通过调用的Graphics.FromImage(bitmap1)

  4. 呼叫的graphics.DrawImage(bitmap2 ...)把第二图像上的第一个
  5. bitmap1.Save(... )新的图像保存到一个文件中。


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#?

解决方案

  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.

这篇关于如何两个图像合并成一个单一的Jpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆