Thread: glowing label

Results 1 to 8 of 8
  1. #1
    Kudi's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    207
    Reputation
    18
    Thanks
    287
    My Mood
    Tired

    glowing label

    Hi mpgh i have made a glowing label
    and now i want to realease it

    Code:
    'GlowLabel by Kudi
    
    Imports System.Runtime.InteropServices
    Imports System.Drawing.Imaging
    
    Public Class GlowLabel
        Inherits Label
    
        Private _glowColor As Color = Color.White
    
        Public Overridable Property GlowColor() As Color
            Get
                Return _glowColor
            End Get
            Set(ByVal value As Color)
                _glowColor = value
                Me.Invalidate()
            End Set
        End Property
    
        Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
            MyBase.OnPaintBackground(pevent)
    
            Using b As New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height)
                Using g As Graphics = Graphics.FromImage(b)
                    Dim e As New PaintEventArgs(g, pevent.ClipRectangle)
    
                    Me.OnPaint(e)
                End Using
    
                BlurImage(b)
    
                pevent.Graphics.DrawImageUnscaled(b, 0, 0)
            End Using
        End Sub
    
        <StructLayout(LayoutKind.Explicit)>
        Private Structure ColorArgb
            <FieldOffset(0)> Public Value As Integer
            <FieldOffset(3)> Public A As Byte
            <FieldOffset(2)> Public R As Byte
            <FieldOffset(1)> Public G As Byte
            <FieldOffset(0)> Public B As Byte
        End Structure
    
        Private Sub BlurImage(ByVal b As Bitmap)
            Const Radius As Integer = 1
    
            Dim bd As BitmapData = b.LockBits(New Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb)
            Dim arr(bd.Width * bd.Height - 1) As Integer
            Dim arr2(arr.Length - 1) As Integer
            Marshal.Copy(bd.Scan0, arr, 0, arr.Length)
            Marshal.Copy(bd.Scan0, arr2, 0, arr2.Length)
    
            Dim vals(8) As ColorArgb
            Dim val As ColorArgb
            val.R = Me.GlowColor.R
            val.G = Me.GlowColor.G
            val.B = Me.GlowColor.B
    
            For i As Integer = 1 To Radius
                For x As Integer = 1 To bd.Width - 2
                    For y As Integer = 1 To bd.Height - 2
                        For dX As Integer = -1 To 1
                            For dY As Integer = -1 To 1
                                vals(dY * 3 + dX + 4).Value = arr2((y + dY) * bd.Width + x + dX)
                            Next
                        Next
    
                        val.A = CByte((From z As ColorArgb In vals Select CInt(z.A)).Sum() \ 9)
    
                        arr(y * bd.Width + x) = val.Value
                    Next
                Next
                If i < Radius Then arr2 = DirectCast(arr.Clone(), Integer())
            Next
    
            Marshal.Copy(arr, 0, bd.Scan0, arr.Length)
            b.UnlockBits(bd)
        End Sub
    End Class
    
    Imports System.Runtime.InteropServices
    Imports System.Drawing.Imaging
    
    Public Class GlowLabel
        Inherits Label
    
        Private _glowColor As Color = Color.White
    
        Public Overridable Property GlowColor() As Color
            Get
                Return _glowColor
            End Get
            Set(ByVal value As Color)
                _glowColor = value
                Me.Invalidate()
            End Set
        End Property
    
        Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
            MyBase.OnPaintBackground(pevent)
    
            Using b As New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height)
                Using g As Graphics = Graphics.FromImage(b)
                    Dim e As New PaintEventArgs(g, pevent.ClipRectangle)
    
                    Me.OnPaint(e)
                End Using
    
                BlurImage(b)
    
                pevent.Graphics.DrawImageUnscaled(b, 0, 0)
            End Using
        End Sub
    
        <StructLayout(LayoutKind.Explicit)>
        Private Structure ColorArgb
            <FieldOffset(0)> Public Value As Integer
            <FieldOffset(3)> Public A As Byte
            <FieldOffset(2)> Public R As Byte
            <FieldOffset(1)> Public G As Byte
            <FieldOffset(0)> Public B As Byte
        End Structure
    
        Private Sub BlurImage(ByVal b As Bitmap)
            Const Radius As Integer = 1
    
            Dim bd As BitmapData = b.LockBits(New Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb)
            Dim arr(bd.Width * bd.Height - 1) As Integer
            Dim arr2(arr.Length - 1) As Integer
            Marshal.Copy(bd.Scan0, arr, 0, arr.Length)
            Marshal.Copy(bd.Scan0, arr2, 0, arr2.Length)
    
            Dim vals(8) As ColorArgb
            Dim val As ColorArgb
            val.R = Me.GlowColor.R
            val.G = Me.GlowColor.G
            val.B = Me.GlowColor.B
    
            For i As Integer = 1 To Radius
                For x As Integer = 1 To bd.Width - 2
                    For y As Integer = 1 To bd.Height - 2
                        For dX As Integer = -1 To 1
                            For dY As Integer = -1 To 1
                                vals(dY * 3 + dX + 4).Value = arr2((y + dY) * bd.Width + x + dX)
                            Next
                        Next
    
                        val.A = CByte((From z As ColorArgb In vals Select CInt(z.A)).Sum() \ 9)
    
                        arr(y * bd.Width + x) = val.Value
                    Next
                Next
                If i < Radius Then arr2 = DirectCast(arr.Clone(), Integer())
            Next
    
            Marshal.Copy(arr, 0, bd.Scan0, arr.Length)
            b.UnlockBits(bd)
        End Sub
    End Class


    you can also change the glow color



    Instruction:
    1. make a new class
    2. paste the code into the new class
    3. debug your project
    finish

  2. #2
    cgallagher21's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    1,627
    Reputation
    11
    Thanks
    325
    My Mood
    Angelic
    Nice labels, cool idea. What's gdi?

  3. #3
    iZ3RO's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    191
    Reputation
    32
    Thanks
    536
    My Mood
    Stressed
    GDI is a graphic device interface used for drawing shapes and forms on-screen.
    It is actually REALLY fun to learn. Hit me up on MSN and I can help you learn a
    bunch of it. (xZ3ROxPROJ3CTx@H4CKforums.net)

    P.S. That 4 in my MSN is supposed to be an 'a'

    ~ZerO
    [IMG]https://iforum.*****.net/sig/1.png[/IMG]
    [IMG]https://iforum.*****.net/sig/2.png[/IMG]
    [IMG]https://iforum.*****.net/sig/3.png[/IMG]
    [IMG]https://iforum.*****.net/sig/4.png[/IMG][IMG]https://iforum.*****.net/sig/5.png[/IMG]
    [IMG]https://iforum.*****.net/sig/6.png[/IMG]
    [IMG]https://iforum.*****.net/sig/7.png[/IMG][IMG]https://iforum.*****.net/sig/8.png[/IMG]
    [IMG]https://iforum.*****.net/sig/9.png[/IMG][IMG]https://iforum.*****.net/sig/11.png[/IMG]
    [IMG]https://iforum.*****.net/sig/12.png[/IMG]

  4. #4
    Hugo Boss's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    28,753
    Reputation
    4790
    Thanks
    5,902
    My Mood
    Angelic
    Nice labels (:

     
    Super User since 08-29-2017
    Global Moderator from 10-02-2016 - 08-29-2017
    Premium Seller since 11-16-2016
    Moderator from 09-24-2015 - 01-09-2016
    Alliance of Valiant Arms Minion from 11-12-2015 - 01-09-2016
    Market place Minion from 09-24-2015 - 01-09-2016
    Crossfire Minion from 09-11-2015 - 01-09-2016

    Middleman from 07-07-2015 - 01-09-2016
    Market Place Minion from 03-03-2014 - 08-01-2014
    Middleman from 01-30-2014 - 08-01-2014
    Moderator from 03-29-2013 - 04-04-2013
    Market Place Minion from 03-07-2013 - 04-04-2013
    Premium Member since 01-25-2013
    Middleman from 12-04-2012 - 04-04-2013
    Registered since 10-9-2011

  5. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,682
    My Mood
    Breezy
    Isn't it funny how I found this code on a another forum and it was posted back in June? So unless you're minitech which I highly doubt as comparing the grammar to his post and yours, there's a significant difference. So obviously, you leeched this.
    Last edited by master131; 10-25-2011 at 11:21 PM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  6. #6
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Post credits, obvious leech is obvious. Don't claim to have created stuff we can obviously tell isn't yours.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  7. #7
    FUKO's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    PBlackout.exe /mhu
    Posts
    11,128
    Reputation
    1103
    Thanks
    3,860
    Actually looks pretty nice with a darker background color, if you set the glowcolor to lime..
    Would say nice job, but it's not yours.

  8. #8
    Reflex-'s Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    192.168.1.01
    Posts
    6,625
    Reputation
    584
    Thanks
    2,267
    My Mood
    Dead
    nice Job was this leeched

Similar Threads

  1. [TUT]How to make a link Label
    By Pixie in forum Visual Basic Programming
    Replies: 2
    Last Post: 09-03-2009, 06:55 AM
  2. Glowing animation tutorial
    By Humper in forum Tutorials
    Replies: 27
    Last Post: 06-16-2009, 03:04 PM
  3. Glow Text- Plz rate
    By blueduece2 in forum Showroom
    Replies: 2
    Last Post: 04-23-2009, 02:37 AM
  4. Replies: 4
    Last Post: 03-13-2008, 03:57 PM
  5. Hl to label
    By smartie in forum Visual Basic Programming
    Replies: 5
    Last Post: 07-03-2007, 11:00 AM