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 开发者_如何学Cit and extracting the image there.
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
精彩评论