Sweet Celestia
Newcomer
small little program that uses GDI+ to get an image from any file type.
You need:
2 buttons
1 picturebox
Open button:
Then just save the image loaded into the picturebox with this.
Save Icon button:
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)
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)

