【发布时间】:2009-04-28 14:00:17
【问题描述】:
我有一个 WebBrowser 控件,顶部有一个透明面板,我想做的是在透明面板上围绕鼠标悬停的页面中的元素绘制一个矩形。
到目前为止,除了在绘制下一个矩形之前没有清除面板之外,我一切正常,所以我最终到处都是矩形。
这是我正在使用的代码。
paneGraphics = drawingPane.CreateGraphics();
Rectangle inspectorRectangle;
inspectorRectangle = controller.inspectElement();
paneGraphics.DrawRectangle(new Pen(Color.Blue, 1), inspectorRectangle);
drawingPane.Invalidate();
我尝试过使用 drawingPane.clear() 但这只会使屏幕变白。
【问题讨论】:
标签: c# graphics panel transparent