我创建了一个可以渲染和保存给定元素的应用程序。
With windowElements
.Add("statusBar", _
VisualStyleElement.Window.CloseButton.Normal) 'need each element
End With
'calculate rect
Dim heightMinusFrame As Integer = _
ClientRectangle.Height - frameThickness
' Calculate the status bar rectangles and add them
' to the Dictionary of rectangles.
For Each entry In windowElements
SetRenderer(entry.Value)
elementRectangles("statusBar") = _
New Rectangle(0, 0, elemsize.Width, elemsize.Height)
Dim image = New Bitmap(elemsize.Width, elemsize.Height, PixelFormat.Format32bppArgb)
Dim gfx = Graphics.FromImage(image)
gfx.Clear(Color.Transparent)
renderer.DrawBackground(gfx, _
elementRectangles(entry.Key))
image.Save("btn.png")
Next entry
这很有效,除了我必须指定我想要的元素,我基本上想要所有这些元素。是否存在某种可以遍历所有可能元素的东西?
由于