Loading Image as a data url
Loading Image as a data url
Which method I need to load a image via a data url?
The image data ist stored in a database, as string.
Example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAEsCAYAAAAfPc2WAAAS2ElEQVR4Xu3dMYusZwEF4BOsbNSAnYWo6TWE" and lot more
Thank you
Eric
The image data ist stored in a database, as string.
Example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAEsCAYAAAAfPc2WAAAS2ElEQVR4Xu3dMYusZwEF4BOsbNSAnYWo6TWE" and lot more
Thank you
Eric
Re: Loading Image as a data url
I solved it by some extra code:
Code: Select all
var base64Data = Regex.Match(data, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
var binData = Convert.FromBase64String(base64Data);
GdPictureImaging image = new GdPictureImaging();
var imageId = image.CreateGdPictureImageFromByteArray(binData);
Re: Loading Image as a data url
Hi Eric,
Thanks for posting your message here aswell as contacting us on our helpdesk.
I am glad you managed to solve this issue here.
Have a great day.
Regards,
Hugo Cudd
Technical Support
Thanks for posting your message here aswell as contacting us on our helpdesk.
I am glad you managed to solve this issue here.
Have a great day.
Regards,
Hugo Cudd
Technical Support
Re: Loading Image as a data url
I think so, I use it on Windows, written in C#.
But only basic functions are used, so it should work everywhere. Split up the data url to get the plain data without the header, convert it from base64 to binary, load it into GDPicture
But only basic functions are used, so it should work everywhere. Split up the data url to get the plain data without the header, convert it from base64 to binary, load it into GDPicture
Who is online
Users browsing this forum: No registered users and 0 guests