本文整理匯總了VB.NET中System.Drawing.Drawing2D.Blend.Factors屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET Blend.Factors屬性的具體用法?VB.NET Blend.Factors怎麽用?VB.NET Blend.Factors使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Drawing.Drawing2D.Blend
的用法示例。
在下文中一共展示了Blend.Factors屬性的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