的WinForms:控制的最大尺寸是65535

编程入门 行业动态 更新时间:2024-10-26 16:22:02
本文介绍了的WinForms:控制的最大尺寸是65535 - 解决方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在WinForms和C#,看来我不能创建宽于65535。如果我将它设置为70.000,该值被重置为65535 控制通过Control.Size与ILSpy源挖。我不'T立即找到负责夹紧大小不同的代码。

In WinForms and C#, it seems I cannot create a control wider than 65535. If I set it to 70.000, the value gets reset to 65535. Digging through the source of Control.Size with ILSpy, I couldn't immediately find the code responsible for clamping the size.

所以这是Win32 API或Windows窗体的限制吗?有没有解决这个问题,例如,任何方式与非托管互操作?

So is this a limit of the Win32 API or of Windows Forms? Is there any way around this, e.g. with unmanaged interop?

我需要这样一个大的控制的原因是我画的很长的音频文件的音乐波形到它。 (是的,我可以直接绘制波形,没有一个包含控制,但是这将需要大量的重构)。我说的不是绘图代码在这里。显然,有必要只绘制可见部分,但事情是,我想有尽可能广泛200.000像素的控制。

The reason I need such a large control is that I draw music waveform of very long audio files onto it. (Yes, I could draw the waveform directly, without a containing control; but that would require lots of refactoring). I am not talking about the drawing code here. Clearly it's necessary to draw only the visible part, but the thing is that I'd like to have a control as wide as 200.000 pixels.

推荐答案

这是一个WINAPI限制。一个漂亮的硬的,鼠标的位置报道,比方说,与挤进LPARAM参数鼠标位置的WM_MOUSEMOVE消息。随着对X-16位和Y型的位置16位。

It is a winapi restriction. A pretty hard one, the mouse position is reported with, say, the WM_MOUSEMOVE message with the mouse position packed into the LPARAM argument. With 16 bits for the X- and 16-bits for Y-location.

您必须处理它。它不是例如限制面板的AutoScrollMinSize属性还。这就是你永远在这种情况下使用,无论如何,在开始画AutoScrollPosition

You'll have to deal with it. It is not a limitation on for example the AutoScrollMinSize property of a panel. Which is what you'd always use in this case anyway, start painting at AutoScrollPosition.

更多推荐

的WinForms:控制的最大尺寸是65535

本文发布于:2023-10-08 08:54:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472125.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:尺寸   WinForms

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!