[Source] Easy Icon Extractor

Discussion in 'Programming General' started by Sweet Celestia, Jul 22, 2012.

[Source] Easy Icon Extractor
  1. Unread #1 - Jul 22, 2012 at 2:32 PM
  2. Sweet Celestia
    Joined:
    Jun 20, 2012
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0

    Sweet Celestia Newcomer

    [Source] Easy Icon Extractor

    small little program that uses GDI+ to get an image from any file type.

    You need:
    2 buttons
    1 picturebox

    Code:
    Imports System.Drawing
    Imports System.Drawing.Imaging
    Open button:
    Code:
    Dim OpenFileDialog As New OpenFileDialog
    
            OpenFileDialog.Title = "Select File"
            OpenFileDialog.Filter = "All Files (*.*)|*.*"
    
            If OpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
    
                PictureBox.Image = Drawing.Icon.ExtractAssociatedIcon(OpenFileDialog.FileName).ToBitmap
    
            End If
    Then just save the image loaded into the picturebox with this.

    Save Icon button:
    Code:
    Dim saveDialog As New SaveFileDialog
    
            SaveFileDialog.Title = "Save Image"
            SaveFileDialog.Filter = _
                "Image File Types (*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png)|*.bmp;*.gif;*.ico;*.jpg;*.jpeg;*.png"
    
            If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
    
                PictureBox.Image.Save(SaveFileDialog.FileName)
    
            End If
    Just copy and paste!

    I churned this out yesterday and I thought I would share.
    Here are the project files if you desire them.

    Download Project Files (ZIP Format)

    + a standalone executable if you wish.

    Download Standalone (EXE Format)
     
< [Source] Easy Icon Extractor | Need help with simple coding >

Users viewing this thread
1 guest


 
 
Adblock breaks this site