本文整理汇总了VB.NET中System.Drawing.Drawing2D.Blend.Positions属性的典型用法代码示例。如果您正苦于以下问题:VB.NET Blend.Positions属性的具体用法?VB.NET Blend.Positions怎么用?VB.NET Blend.Positions使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Drawing.Drawing2D.Blend
的用法示例。
在下文中一共展示了Blend.Positions属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: DemonstrateBlend
Private Sub DemonstrateBlend(ByVal e As PaintEventArgs)
Dim blend1 As New Blend(9)
' Set the values in the Factors array to be all green,
' go to all blue, and then go back to green.
blend1.Factors = New Single() {0.0F, 0.2F, 0.5F, 0.7F, 1.0F, _
0.7F, 0.5F, 0.2F, 0.0F}
' Set the positions.
blend1.Positions = New Single() {0.0F, 0.1F, 0.3F, 0.4F, 0.5F, _
0.6F, 0.7F, 0.8F, 1.0F}
' Declare a rectangle to draw the Blend in.
Dim rectangle1 As New Rectangle(10, 10, 120, 100)
' Create a new LinearGradientBrush using the rectangle,
' green and blue. and 90-degree angle.
Dim brush1 As New LinearGradientBrush(rectangle1, _
Color.LightGreen, Color.Blue, 90, True)
' Set the Blend property on the brush to the custom blend.
brush1.Blend = blend1
' Fill in an ellipse with the brush.
e.Graphics.FillEllipse(brush1, rectangle1)
' Dispose of the custom brush.
brush1.Dispose()
End Sub