webimage url to picture

Hi guys,

I had a url which has “data:image/jpeg;base64,” format.
Maybe you can help me on how to come up with PICTURE value from webimage url?

Thank you!

Wait. Are you talking about a WebFile pointing to an image ? If so, the picture is at the FolderItem you created the Webfile with.

Or you are talking about something else entirely ?

BTW I don’t know what you mean by WebImage. Are you talking about a WebPicture ?

If so, same observation. From what/where/how did you create that Picture in the first place ?

Thanks for the reply Michel,

What I mean is “WebImageView”.

My Webimageview.URL received long string from a webcam (here is the sample chunk >> “data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2N”)

It display the photo correctly but when I accessed the PICTURE property, I noticed it has a value of NIL.

Any idea on how to get the PICTURE property so that I can save it to database.

Thanks in advance.

Un-base64 the “url” and it’s the binary data for the image.

Thank Tim!

Could you help me on how to accomplish that? I need my WebImageView to get the PICTURE property.

Hi Guys,

Anybody is willing to help?

Try something like this to display the image using WebImageView picture property:

dim imageText As Text = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="

dim imageDataParts() As Text = imageText.Split(",")

dim imageBase64 As Text = imageDataParts(1)

dim picData As MemoryBlock
picData = DecodeBase64( imageBase64 )

dim p as Picture = Picture.FromData( picData )
ImageView1.Picture = p

Thank you Tony!