我有一个 C# 表单,上面有几个控件,部分控件一个一个地位于另一个控件上。我想要一个函数,该函数将从表单中获取控件作为输入,并返回必须位于控件后面的图像。例如:如果表单具有背景图像并包含一个按钮 - 如果我运行此函数,我将获得位于按钮后面的背景图像部分。有什么想法和代码吗?
帮助!!!
I have c# form which have several controls on it, part of the controls are located one on another. I want a function that will take for input a control from the form and will return the image that has to be behind the control. for ex: if the form has backgroundimage and contains a button on it - if I'll run this function I'll got the part of backgroundimage that located behind the button. any Idea - and code?
H-E-L-P!!!
发布评论
评论(1)
使用图像地图可能更简单 http://www.echoecho.com/htmllinks07.htm
您可以使用 Page.ClientScript.GetCallback... 创建链接...
编辑:Winforms 解决方案
这将获取“this”的背景图像,您可以将其更改为表单对象,并将按钮的相同位置和大小的任何内容复制到位图对象。
It may be simpler to use an image map http://www.echoecho.com/htmllinks07.htm
You can create your links using Page.ClientScript.GetCallback...
Edit: Winforms solution
This takes the background image of 'this' which you can change to your form object and copies the whatever is at the same position and size of your button to a bitmap object.