Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将大小相等的图像网格缝合在一起_C#_.net_Image Processing - Fatal编程技术网

C# 将大小相等的图像网格缝合在一起

C# 将大小相等的图像网格缝合在一起,c#,.net,image-processing,C#,.net,Image Processing,我有一个26×13的网格,每个都是512px×512px。都是.jpgs。是否有一个库或简单的方法将这些图像缝合到一个大的.jpg文件中?我看了一下,只发现对于我需要做的事情来说过于复杂的库 谢谢你的帮助 编辑:我找到了问题的解决方案。我用一些相当简单的代码设法做到了这一点 using (Bitmap result = new Bitmap(26 * 512, 13 * 512)) { for (int x = 0; x < 26;

我有一个26×13的网格,每个都是512px×512px。都是.jpgs。是否有一个库或简单的方法将这些图像缝合到一个大的.jpg文件中?我看了一下,只发现对于我需要做的事情来说过于复杂的库

谢谢你的帮助


编辑:我找到了问题的解决方案。

我用一些相当简单的代码设法做到了这一点

        using (Bitmap result = new Bitmap(26 * 512, 13 * 512))
        {
            for (int x = 0; x < 26; x++)
                for (int y = 0; y < 13; y++)
                    using (Graphics g = Graphics.FromImage(result))
                        g.DrawImage(images[x, y], x * 512, y * 512);
            result.Save(file, format);
        }
使用(位图结果=新位图(26*512,13*512))
{
对于(int x=0;x<26;x++)
对于(int y=0;y<13;y++)
使用(Graphics g=Graphics.FromImage(结果))
g、 DrawImage(图像[x,y],x*512,y*512);
结果.保存(文件、格式);
}

我用一些相当简单的代码成功地做到了这一点

        using (Bitmap result = new Bitmap(26 * 512, 13 * 512))
        {
            for (int x = 0; x < 26; x++)
                for (int y = 0; y < 13; y++)
                    using (Graphics g = Graphics.FromImage(result))
                        g.DrawImage(images[x, y], x * 512, y * 512);
            result.Save(file, format);
        }
使用(位图结果=新位图(26*512,13*512))
{
对于(int x=0;x<26;x++)
对于(int y=0;y<13;y++)
使用(Graphics g=Graphics.FromImage(结果))
g、 DrawImage(图像[x,y],x*512,y*512);
结果.保存(文件、格式);
}

您可以在matlab中完成:您需要自己编写一些定位代码,并提前确定生成位图的大小,否则,是的,linked
g.DrawImage
方法将完成这项工作。您可以在matlab中完成这项工作:您需要自己编写一些定位代码,并提前确定生成位图的大小,但是,是的,linked
g.DrawImage
方法将完成这项工作。