2012-02-07 104 views
-3

嘿,我所有的代码都支持在我的窗体上叠加透明矩形。计划是,我不知道是什么“E”应设置/定义为:在窗体上创建透明矩形

e.Graphics.FillRectangle(color.fromargb(127.5,255,255,255), New Rectangle(0, 0, 100, 100)) 

任何帮助将是巨大的!

大卫

更新

' Create solid brush. 
    Dim blueBrush As New SolidBrush(Color.Blue) 

    ' Create location and size of rectangle. 
    Dim x As Single = 0.0F 
    Dim y As Single = 0.0F 
    Dim width As Single = 200.0F 
    Dim height As Single = 200.0F 
    ' Fill rectangle to screen. 
    e.Graphics.FillRectangle(blueBrush, x, y, width, height) 
+0

您的代码似乎是C#。你用VB.NET标记。此外,这与directX无关,而是Graphix类。 – Kris 2012-02-07 23:52:08

+0

用新代码更新了OP。 – StealthRT 2012-02-08 00:02:42

+0

http://social.msdn.microsoft.com/forums/en-US/winforms/thread/3087655c-bd50-4408-9c55-dd179e442675/ – 2012-02-08 00:52:03

回答

2

您将需要实现在窗体的OnPaint方法的代码。 ePaintEventArgs的类型。

+0

用新代码更新了OP。 – StealthRT 2012-02-08 00:01:38