如何在 WinForms 中绘制图像反射?
我想在 C# (WinForms) 中绘制图像的反射,因此我需要能够水平翻转图像。我知道我可以使用 image.RotateFlip 来做到这一点,但这种方法的问题是我必须翻转图像两次,以便我可以在下一次绘制时再次将其右侧向上绘制。每个图像的每个绘制执行两次似乎很慢。
我想在绘制图像时进行翻转,所以我只需要翻转一次,但我找不到任何方法来做到这一点。这可能吗?
我考虑过的另一种方法是以某种方式翻转图形对象,正常绘制图像,然后将图形对象翻转回来,以便下一次绘制是正确的。如果这比翻转图像两次更快,可以吗?
另外,我不想在内存中保留 2 个图像,因此我无法复制图像并翻转克隆。
I want do draw a reflection in C# (WinForms) of an image, so I need to be able to flip the image horizontally. I know I can do this with image.RotateFlip, but the problem with this approach is that I have to flip the image twice so I can draw it again the right side up on the next paint. Doing this twice per paint per image seems to be slow.
I would like to do the flip when I draw the image so I only have to flip it once, but I can't find any way to do this. Is this possible?
Another approach I've considered is somehow flipping the graphics object, drawing the image normally, and then flipping the graphics object back so that the next paint is correct. If this is faster than flipping the image twice, is it possible to do?
Also, I don't want to keep 2 images in memory, so I can't copy the image and flip the clone.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 此处 获取此代码并检查一下是否是任何帮助。
Got this code from here and check out and see if it is of any help.
编辑
<罢工>
也是这样的吗?
好的,rotateflip 不返回图像
看看这个,旋转翻转只需翻转一次就足够了。不?
edit
something like this too?
ok, rotateflip doesn't return an image
looking at this, only one flip is enough from the rotateflip. no?