Set Sigma Bell Shape : LinearGradientBrush « 2D Graphics « VB.Net Tutorial






Set Sigma Bell Shape
Imports System.Drawing.Text
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms

public class LinearGradientSetSigmaBellShape
   public Shared Sub Main
        Application.Run(New LinearGradientBrushesForm)
   End Sub
End class

Public Class LinearGradientBrushesForm
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        components = New System.ComponentModel.Container()
        Me.Text = "LinearGradientBrushesForm"
    End Sub

#End Region


    Private Sub LinearGradientBrushesForm_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles MyBase.Paint
        Dim g As Graphics = e.Graphics
        Dim x As Integer = 0
        Dim y As Integer = 0
        Dim width As Integer = Me.ClientRectangle.Width
        Dim height As Integer = Me.ClientRectangle.Height / 4
        Dim blackBrush As Brush = Brushes.Black

        Dim b As LinearGradientBrush = New LinearGradientBrush(Me.ClientRectangle, Color.White, Color.Black, LinearGradientMode.Horizontal)

        b.SetSigmaBellShape(0.5)
        g.FillRectangle(b, x, y, width, height)
        g.DrawString("Bell", Me.Font, blackBrush, x, y)
    End Sub

End Class








17.56.LinearGradientBrush
17.56.1.A diagonal brushA diagonal brush
17.56.2.Create a LinearGradientBrushCreate a LinearGradientBrush
17.56.3.Set Blend Triangular Shape for LinearGradientBrushSet Blend Triangular Shape for LinearGradientBrush
17.56.4.Set Sigma Bell ShapeSet Sigma Bell Shape
17.56.5.Make a rectangle that shades from black to whiteMake a rectangle that shades from black to white
17.56.6.LinearGradientBrush: InterpolationColorsLinearGradientBrush: InterpolationColors
17.56.7.LinearGradientBrush ColorBlendLinearGradientBrush ColorBlend
17.56.8.LinearGradientBrush BlendLinearGradientBrush Blend
17.56.9.LinearGradientBrush: too short to cross the whole rectangleLinearGradientBrush: too short to cross the whole rectangle
17.56.10.Change the LinearGradientBrush's WrapModeChange the LinearGradientBrush's WrapMode
17.56.11.Trangular brushTrangular brush
17.56.12.Transform LinearGradientBrushTransform LinearGradientBrush
17.56.13.Blend PropertiesBlend Properties
17.56.14.Interpolation ColorsInterpolation Colors
17.56.15.LinearGradientBrush.SetBlendTriangularLinearGradientBrush.SetBlendTriangular
17.56.16.LinearGradientBrush.SetSigmaBellShapeLinearGradientBrush.SetSigmaBellShape
17.56.17.LinearGradientBrush.GammaCorrectionLinearGradientBrush.GammaCorrection