本文整理汇总了VB.NET中System.Drawing.Drawing2D.ColorBlend.ColorBlend构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET ColorBlend构造函数的具体用法?VB.NET ColorBlend怎么用?VB.NET ColorBlend使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了ColorBlend构造函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: OnPaint
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
' Draw ellipse using ColorBlend.
Dim startPoint2 As New Point(20, 110)
Dim endPoint2 As New Point(140, 110)
Dim myColors As Color() = {Color.Green, Color.Yellow, _
Color.Yellow, Color.Blue, Color.Red, Color.Red}
Dim myPositions As Single() = {0.0F, 0.2F, 0.4F, 0.6F, 0.8F, 1.0F}
Dim myBlend As New ColorBlend
myBlend.Colors = myColors
myBlend.Positions = myPositions
Dim lgBrush2 As New LinearGradientBrush(startPoint2, endPoint2, _
Color.Green, Color.Red)
lgBrush2.InterpolationColors = myBlend
Dim ellipseRect2 As New Rectangle(20, 110, 120, 80)
e.Graphics.FillEllipse(lgBrush2, ellipseRect2)
End Sub