Splash screen

  • 14 years ago

    Hello,

    I am new to VB.NET since September 2006.

    I have a project that requires to create the code for two traingles with a graduated color scheme in a splash screen form. Hint: These triangles were created by drawing successibely shorter lines and varying the color for each line drawn. The top triangle varies the green value from 0 to 255. The red and blue values are zero. The lower-right triangle was created by varing the blue from 255 to 0. The red and green values are 0.

    I do not know how to create these triangles. I need your help.

    Many thanks.

    Regena

  • 14 years ago
    Are you required to create the triangles using code or can you just create an image in another program and use that for your splash screen?
  • 14 years ago

    I am required to write codes to create two triangles with a graduated color scheme.

    Sorry for the confusion.

    Thanks,

    Regena

  • 14 years ago
    Here is a little code and info that might help out a little.
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            'An array of points that defines a triangle
            Dim points(2) As Point
            'An image the size of the form
            Dim bmp As New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height)
            'A graphics object to do the drawing
            Dim gr As Graphics = Graphics.FromImage(bmp)
    
            'Bottom left point
            points(0) = New Point(0, bmp.Height)
            'Bottom right point
            points(1) = New Point(bmp.Width, bmp.Height)
            'Top middle point
            points(2) = New Point(CInt(bmp.Width / 2), 0)
    
            'Use AntiAliasing to create smoother edges
            gr.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
    
            'Fill a polygon defined by the points array and filled with blue
            gr.FillPolygon(Brushes.Blue, points)
            'Clean up
            gr.Dispose()
    
            'Set the forms background image to our triangle
            Me.BackgroundImage = bmp
    
            'I don't know much about creating gradients but I know you can create
            'gradient brushes using:
            'System.Drawing.Drawing2D.LinearGradientBrush()
            'System.Drawing.Drawing2D.PathGradientBrush()
            'Hopefully this will get you started.
        End Sub
  • 14 years ago

    Thanks. It looks harder. I will let you know if this one is what I want.

    Many thanks,

    Regena

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match” - Bill Bryson