C#图像拼接 [英] C# image concatenation

查看:608
本文介绍了C#图像拼接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想是,取3个图像,即第一图像,其保持为原始大小anothother图像拼接到它仅使用第一图像大小(起始的左侧)的1/2的底部什么。然后从第三个图像,并把它放在我看了例如全天第一个图像的右下角一半,没有任何人有一个想法或想法?

What i want to is, take 3 images, that the 1st image, keep it to original size concatenate anothother image to the bottom of it only using 1/2 of the first images size( starting on the left side). Then take the 3rd image and put it on the bottom right half of the first image I've looked for example all day, does anybody have an idea or an idea?

推荐答案

如果你忽略了长宽比:

        Image img1;
        Image img2;
        Image img3;

        Bitmap display = new Bitmap(img1.Width, (int)(img1.Height * 1.5));
        Graphics g = Graphics.FromImage(display);

        //draw img1 to upper left corner
        g.DrawImage(img1, 0, 0);

        //draw img2 under img1, left side
        g.DrawImage(img2, 0, img1.Height, img1.Width / 2.0f, img1.Height / 2.0f);

        //draw img3 under img1, right side
        g.DrawImage(img3, img1.Width / 2.0f, img1.Height, img1.Width / 2.0f, img1.Height / 2.0f);

这篇关于C#图像拼接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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