views:

90

answers:

1

I have a small vb.net app that have a few images in an embedded resource.

Is there a way I could extract one of those images to a folder from the same exe that contains the resource?, like clicking a button, selecting a folder to save it and extracting the image there.

A: 

Resource images can just be saved from the exe. Use a "SaveFileDialog" control to get the filename.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    SaveFileDialog1.ShowDialog()
End Sub

Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
    My.Resources.Image2.Save(SaveFileDialog1.FileName, Drawing.Imaging.ImageFormat.Gif)
End Sub
Carter
EDIT: Added example for SaveFileDialog control
Carter
Thats awesome, thanks a lot!
jahmax
May I get an upvote?
Carter