Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3334592
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:55:20+00:00 2026-05-17T23:55:20+00:00

I’m currently building an intranet engine for a project I’ve got on the go

  • 0

I’m currently building an intranet engine for a project I’ve got on the go at the moment, and I’d like to save myself a little time by generating header images from code where possible, however, I’d like it to match our concept image.

What I’d like to achieve is below:

Some Text

My issue is I’ve not the faintest how to create that from code. I can do the absolute basics but that’s about it.

I start to fall down when it comes to the gradient background and the drop shadow on the text. I can get away with positioning the text on the larger header image, so if it’s not possible to generate the exact gradient I have there, then I have a work around for that, but what I really want to achieve is the text with the font and drop shadow.

I’d say it’s safe to assume that to use a “non-standard” font, I’d merely need to install it on the web server?

Thanks for any help in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:55:20+00:00Added an answer on May 17, 2026 at 11:55 pm

    Here’s code to perform the task but it’s for WinForms. It shouldn’t be difficult to apply it to a web server:

    Imports System.Drawing
    Imports System.Drawing.Drawing2D
    Imports System.windows.Forms
    
    Public Class Form1
    
        Sub Form1_Paint(ByVal sender As Object, _
                        ByVal e As PaintEventArgs) Handles MyBase.Paint
    
            'g is the graphics context used to do the drawing.'
            'gp is the path used to draw the circular gradient background'
            'f is a generic font for drawing'
    
            Using g = e.Graphics, gp As New GraphicsPath(), _
                  f As New Font(FontFamily.GenericSansSerif, 20, FontStyle.Bold)
    
                'add the ellipse which will be used for the '
                'circular gradient to the graphics path '
                gp.AddEllipse(Me.ClientRectangle)
    
                'then create a path gradient brush from the graphics path '
                'created earlier to do the drawing on the background      '
    
                Using pgb As New PathGradientBrush(gp)
                    'set the center colour '
                    pgb.CenterColor = Color.White
                    'and then make all the colours around it a different colour '
                    pgb.SurroundColors = New Color() {Color.LightSteelBlue}
    
                    'fill a rectangle with the border colour of the gradient brush'
                    g.FillRectangle(Brushes.LightSteelBlue, Me.ClientRectangle)
                    'and then draw the gradient on top'
                    g.FillRectangle(pgb, Me.ClientRectangle)
    
                    'The secret to shadowed text is that the shadow is drawn first'
                    'and it is usually offset to the lower right of the main text '
                    'so we draw the shadow with a shade of grey                   '
                    g.DrawString("SOME TEXT", f, Brushes.Gray, 12, 12)
                    'after which we draw the text itself'
                    g.DrawString("SOME TEXT", f, Brushes.Black, 10, 10)
                End Using
            End Using
        End Sub
    End Class
    

    The code above draws onto the form directly.
    If you’d like to draw to an image instead, modify the code as follows:

    Function GetImage(....) As Image
        Dim bmp As New Bitmap(200,200) 'you may use any size here'
        Dim bmpRect As New Rectangle(Point.Empty, bmp.Size)
    
        Using g = Graphics.FromImage(bmp), ...
            .....
        End Using
    
        return bmp
    End Sub
    

    And be sure to use bmpRect instead of Me.ClientSize.

    I hope this works because this is entirely WinForms.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.