Results 1 to 1 of 1
  1. #1
    The Vector's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    45
    My Mood
    Amazed

    Post [VB.NET] Simple Icon File Extractor

    Hello Guys, I am the Vector and today I will teach them to create a Simple Icon Extractor.

    First let's add it to our source above the public class form1:

    Code:
    Imports System . IO 'without spaces
    Now below the public form1:

    Code:
    Dim extractpath As String
    Dim savepath As String
    Now Add 2 Buttons and Rename it for:
    Browse File
    Extract Icon


    Okay Guys, Now we have to put this on Browse File Button:

    Code:
    Dim open As New OpenFileDialog
            If open.ShowDialog = Windows.Forms.DialogResult.OK Then
                PictureBox1.Image = Icon.ExtractAssociatedIcon(open.FileName).ToBitmap()
                extractpath = open.FileName
            End If
    So, Now put this on Extract Icon:

    Code:
    Dim save As New SaveFileDialog
            save.Filter = "PNG File (*.png)|*.png|Icon Files(*.ico)|*.ico|JPEG Files(*.jpg)|*.jpg|Bitmap Files(*.bmp)|*.bmp"
            If save.ShowDialog = Windows.Forms.DialogResult.OK Then
                savepath = save.FileName
            End If
            If savepath = Nothing Then
                MsgBox("Select a path to save the icon first", MsgBoxStyle.Critical, "Select path!")
                Exit Sub
            End If
    
            Try
                Dim bm As New Bitmap(PictureBox1.Image)
                Dim ico As Icon = Icon.FromHandle(bm.GetHicon)
                Dim fs As New FileStream(savepath, IO.FileMode.CreateNew)
                ico.Save(fs)
                fs.Close()
            Catch ex As Exception
                MsgBox("A following error occured: " & vbCrLf & vbCrLf & ex.ToString)
            End Try
    Okay, now add to your form 1 Picture Box and 1 Timer and your properties enable = true.

    Now put this on timer:

    Code:
    If extractpath = Nothing Then
                Button2.Enabled = False
            Else
                Button2.Enabled = True
            End If
    Okay Guys now we finished the Icon Extractor, remember that is a simple source modified by me! original source is from @Intellectual

    Thanks for this tutorial please!




    Vector - USS Alpha Team


    Want Talk to Me ?

    email: the_vector@live.com
    Skype: TheVectoor

  2. The Following User Says Thank You to The Vector For This Useful Post:

    RoPMadM (04-10-2014)

Similar Threads

  1. [Visual Basics Tutorial] Icon File Extractor
    By Intellectual in forum Programming Tutorials
    Replies: 3
    Last Post: 05-27-2021, 09:48 PM
  2. [Vb.net]Simple hack loader
    By jdslashv2 in forum Programming Tutorials
    Replies: 23
    Last Post: 02-17-2011, 12:37 AM
  3. Re: Simple CA File Deleters
    By Fender94 in forum Combat Arms Hacks & Cheats
    Replies: 15
    Last Post: 08-12-2009, 03:47 PM
  4. Simple CA File Deleters
    By hsicarlos in forum Combat Arms Hacks & Cheats
    Replies: 43
    Last Post: 08-07-2009, 11:40 PM
  5. ICO (Windows Icon) file format plugin for Photoshop
    By MrVader in forum Art & Graphic Design
    Replies: 7
    Last Post: 10-21-2008, 03:15 AM