Link to home
Start Free TrialLog in
Avatar of mainrotor
mainrotor

asked on

I need help embedding Base64 Images using VB.Net - When image is a .jpg

Hi Experts,
Can I embed a .jpg image in using Base64 in my vb.net application.  I have no problem when the image is a .png, but .jpg's don't show up.

Here is the code I am using in my vb.net app:

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim TEST1 As String
        TEST1 = TextBox1.Text
        WebBrowser1.DocumentText = TEST1
    End Sub

Open in new window


Works great when the code I enter in TextBox1.text is something like  <img src=""data:image/png;base64, ...

but when it's a .jpg file it doesn't work.
I even tried changing the code in TextBox1.Text to something like <img src=""data:image/jpg;base64, ...
But it doesn't work.


Do I have to convert my .jpg images to .png?
If so, how?

thanks in advance,
mrotor
Avatar of ste5an
ste5an
Flag of Germany image

Sure that your ".jpeg" is base64 encoded?
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial