Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.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/0/search/2.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# Image.RotateFlip的奇怪行为_C#_.net_Image Processing - Fatal编程技术网

C# Image.RotateFlip的奇怪行为

C# Image.RotateFlip的奇怪行为,c#,.net,image-processing,C#,.net,Image Processing,我的方法有一个奇怪的行为Image.RotateFlip 我需要操作1位深度的位图,当我将512像素大的图像旋转180°时,该方法将图像向左移动一些像素,并在右侧添加一条黑线以填充剩余空间 var image = new Bitmap(@".\spacex_512.bmp"); image.RotateFlip(RotateFlipType.Rotate180FlipNone); image.Save(@".\rotate_180.bmp"); 原件: 翻转: 当图像为511px或513p

我的方法有一个奇怪的行为
Image.RotateFlip

我需要操作1位深度的位图,当我将512像素大的图像旋转180°时,该方法将图像向左移动一些像素,并在右侧添加一条黑线以填充剩余空间

var image = new Bitmap(@".\spacex_512.bmp");
image.RotateFlip(RotateFlipType.Rotate180FlipNone);
image.Save(@".\rotate_180.bmp");
原件:

翻转:

当图像为511px或513px宽时,不会发生此情况

是虫子吗?我能做些什么来解决这个问题


提前感谢您的建议。

是的,这看起来像个bug。有8个像素(相当于一个字节的大小)的过度偏移。也许你可以将图像嵌入一个513像素宽的区域,翻转并裁剪。