Graphics.drawline 8388608限制值 [英] Graphics.drawline 8388608 limit value
本文介绍了Graphics.drawline 8388608限制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好大家
当graphics.drawLine(笔(x1,y1,x2,y2);
X1,y1值或x2,y2值大于8388608 ,绘制反向线,如何解决?
我尝试过:
int y = 8388607;
gfx.DrawLine(new Pen(Color.Red,1),100,100,100,y);
y = 8388608;
gfx.DrawLine(新笔(Color.Blue,1),110,100,110,y);
hello everybody
When the graphics.drawLine (pen (x1, y1, x2, y2);
X1, y1 values or x2, y2 values greater than 8388608, draw inverse line, how to solve?
What I have tried:
int y = 8388607;
gfx.DrawLine(new Pen(Color.Red, 1), 100, 100, 100, y);
y = 8388608;
gfx.DrawLine(new Pen(Color.Blue, 1), 110, 100, 110, y);
推荐答案
简单: GDI使用的坐标系是24位:并且十六进制中的8288607是7FFFFF - 一个大于那个变为负数,因为位23然后被设置。
不,你除了停止尝试绘制荒谬的大坐标之外,我们无能为力!对位图的大小有限制: C#.NET Bitmap的最大分辨率是多少? - 堆栈溢出 [ ^ ]
Simple: the coordinate system GDI uses is 24 bit: and 8288607 in hex is 7FFFFF - one greater than that becomes a negative number as bit 23 is then set.
No, you can't do anything about that, other than stop trying to draw absurdly large coordinates! There are restrictions on how large a bitmap can be anyway: What is the maximum resolution of C# .NET Bitmap? - Stack Overflow[^]
这篇关于Graphics.drawline 8388608限制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文