// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Chimomo's Company">
// Respect the work.
// </copyright>
// <summary>
// Defines the Program type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace CSharpLearning
{
using System.Drawing;
using System.IO;
/// <summary>
/// The program.
/// </summary>
public static class Program
{
/// <summary>
/// The main.
/// </summary>
public static void Main()
{
const string imageFolder = @"D:\Document\Tmp\";
var firstBitmap = new Bitmap(Path.Combine(imageFolder, "First.jpg"));
var secondBitmap = new Bitmap(Path.Combine(imageFolder, "Second.jpg"));
var newBitmap = new Bitmap(firstBitmap.Width + secondBitmap.Width, firstBitmap.Height);
for (var i = 0; i <= firstBitmap.Width - 1; i++)
{
for (var j = 0; j <= firstBitmap.Height - 1; j++)
{
var c = firstBitmap.GetPixel(i, j);
newBitmap.SetPixel(i, j, c);
}
}
for (var i = 0; i <= secondBitmap.Width - 1; i++)
{
for (var j = 0; j <= firstBitmap.Height - 1; j++)
{
var c = secondBitmap.GetPixel(i, j);
newBitmap.SetPixel(i + firstBitmap.Width, j, c);
}
}
newBitmap.Save(Path.Combine(imageFolder, "New.jpg"));
}
}
}
// Output:
/*
*/
分享到:
相关推荐
C#实现的全景图拼接(两张图片合并成一张图片源程序) 这个一个图形学处理中的全景图拼接程序,用的是C#写的,使用vs2005
Android-使用Matrix对Bitmap进行处理
将图片由bitmap类型转换为stream类型再转换为byte[]类型,然后再还原
c#.net Bitmap类的基本使用方法
C#语言下,官方好像没有提供直接的方式把Bitmap转为Mat,但是可以使用我的这个方式转变格式
开源项目-boljen-go-bitmap.zip,go-bitmap - Some simple bitmap utilities - Could someone please review SetAtomic?
3个bitmap文件,用于认识bitmap文件格式的本质
开源项目-seiflotfy-s-bitmap.zip,S-Bitmap: Distinct Counting with a Self-Learning Bitmap (an equivalent to HyperLogLog) implemented in Go
C#--栅格图像打开、保存、处理Bitmap!!
主要对于应用NI Vision和C#的,bitmap和Ni图像之间的一个转换(彩色)
C#中的Bitmap类和Graphics类比较输出,对比相同和不同点
NULL 博文链接:https://410063005.iteye.com/blog/1565595
一个在VC中将Bitmap转换为Byte[]的小例子。
支持用户输入,裁剪切片的:尺寸大小,缩略图名。
2-9+bitmap在连续留存分析中的使用
抓取摄像机视频流一帧的YUV数据,转RGB转bitmap图的类,从现项目中剥离的,保证能用 。
Bitmap Merger is a simple project help you to merge two bitmaps without memory exceptions. The bitmaps are processed in background threads thereby taking the load away from UI thread. Along with merge...
jar包,官方版本,自测可用
可直接运行,支持x86和x64,包含完整代码及引用dll
C# 图片打印 BitmapPrint 京华志&精华志出品 希望大家互相学习,互相进步 支持CSDN 支持微软 主要包括C# ASP.NET SQLDBA 源码 毕业设计 开题报告 答辩PPT等