Convert image to string

Convert image to base64 encoded string and vice versa. Like Resource.resx file does. Can be used with settings file.

    'usage
    Private Sub saveImageToSettings()
        My.Settings.imageSettingAsString = getBase64String(PictureBox1.Image)
        My.Settings.Save()
    End Sub

    Private Sub getImageFromString()
        PictureBox1.Image = getImageFromBase64String(My.Settings.imageSettingAsString)
    End Sub

Continue reading

Advertisements