从一台设备到另一台设备的表面上的 StretchRectangle
是否可以使用 StretchRectangle() 绘制在一个表面上创建的表面设备,到另一个设备上创建的表面?它是为两种不同的控件创建的两种设备。
我不断收到 InvalidCallException
。两个表面都是渲染目标,具有相同的格式并放置在默认池中。
我想问题出在两个不同的设备上?我怎样才能复制这个表面?
更新:
我通过使用 LockRectangle
并使用 GraphicsStream
用于读取和写入另一个表面。我说一些成功,因为我注意到有东西移动是可见的,但我仍然必须确定要读/写多少字节等等,哪个矩形......
Is it possible to use StretchRectangle() to draw a surface created on one device, to a surface created on another device? It are two devices created for two different controls.
I keep getting an InvalidCallException
. Both surfaces are render targets, are of the same format and are placed in the default pool.
I suppose the problem lies in the two different devices? How can I copy this surface?
UPDATE:
I am having some succes by using LockRectangle
and using GraphicsStream
to read from and write to another surface. I'm saying some success since I notice something moving is visible, but I still have to determine how many bytes to read/write and such, which rectangle ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这是不可能的。经过不断的实验,我能够复制有效的表面,但除了以下代码之外,还涉及很多额外的工作。这只是实际的副本。
I believe it is not possible. After continued experimentations I was able to copy a valid surface, but there is a lot of extra effort involved besides the following code. This is just the actual copy.