自定义剪切区域 Windows Mobile 6.x
我们可以在 PaintEventArgs 对象上指定 ClipRectangle 属性来获得矩形裁剪。有没有办法进行自定义形状的剪辑。我想将控件剪辑为具有不同角半径的圆矩形。
We can specify ClipRectangle property on the PaintEventArgs object to get rectangular clipping. Is there a way to do custom shaped clipping. I want to clip the control to a round rect with different corner radiuses.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据CLIPOBJ结构的描述 对于 Windows CE:
这意味着裁剪限制为一系列矩形区域。 Windows Mobile 6.X 基于 Windows CE,因此我认为可以安全地假设同样的限制适用。
一种可能的解决方法是通过 OpenNetCF 使用 GDI+,如上所述 此处,以及 此处。您可以使用类
OpenNETCF.GDIPlus.GraphicsPath
并结合调用AddLine
、AddArc
和AddRectangle
方法以达到同样的目标。According to the description of the CLIPOBJ structure for Windows CE:
Which means that clipping is restricted to a sequence of rectangular regions. Windows Mobile 6.X are based on Windows CE, so I think it is safe to assume that the same restrictions applies.
A possible workaround would be to use GDI+ through OpenNetCF as mentioned here, and here. You could use the class
OpenNETCF.GDIPlus.GraphicsPath
with combination of calls to the methodsAddLine
,AddArc
andAddRectangle
to achieve the same goal.