如何给图片框带来偏斜效果 [英] how to give skew effect to picturebox
本文介绍了如何给图片框带来偏斜效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何给图片框图片提供偏斜效果?
解决方案
你可以很容易地做到这一点,但你不太可能用<$ c来做$ C>图片框。这种控制是非常多余的,如果您做任何非静态,交互式,动画,转换等操作都没有用。
您可能需要倾斜位图图像本身,而不是控件,或者您需要直接在屏幕上产生倾斜。那么你所需要的只是:
https://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform%28v=vs.110%29.aspx [ ^ ] ,
https: //msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix(v=vs.110).aspx [ ^ ]。
如果你马上得不到,那就意味着,很可能是同样的错误观念让你问起PictureBox
会阻止它。然后,您需要采用更长的学习路线,并了解图形渲染的整个主题。我在过去的答案中解释了这一切:
在图片框中附加图片 [ ^ ],
如何从旧图纸中清除面板 [ ^ ],
用C#绘制一个矩形 [ ^ ],
什么样的俏皮方法是Paint? (DataGridViewImageCell.Paint(...)) [ ^ ],
在面板上捕获绘图 [ ^ ],
mdi子表单之间的绘制线 [ ^ ]。
-SA
how to give skew effect to picture box picture ?
解决方案
You can easily do it, but it's very unlikely that you have to do it withPictureBox
. This control is very redundant and is not helpful if you do anything non-static, interactive, animated, something with transform, and so on.
You may need to skew the bitmap image itself, not a control, or you need to produce skew directly on screen. Then all you need is this:
https://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix(v=vs.110).aspx[^].
If you don't get if right away, it means that, most likely, the same misconception which caused you to ask aboutPictureBox
prevents it. Then you need to take a longer learning route and understand the whole topic of graphics rendering. I explained it all in detain in my past answers:
Append a picture within picturebox[^],
How do I clear a panel from old drawing[^],
draw a rectangle in C#[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
capture the drawing on a panel[^],
Drawing Lines between mdi child forms[^].
—SA
这篇关于如何给图片框带来偏斜效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文