I have an image binary data(base64 encoded string) to show in android(mobile) device. Mobile device won't allow if it's size exceeds 64000 bytes. How to resize that image binary data(base 64 encoded string) to show in mobile using c# without exceeding
64000 bytes.
please share any reference to reduce base 64 encoded string of an image.
But to show that image in android mobile device, it allows only Base64 Encoded string. This image data i am getting from MySql(blob field) db
That's not true.
Images are Base64 encoded when the image is embed in an HTML response since HTML is text based. If this is a browser based application then use a handler or Action, depending on the type of application, to allow the browser to download the file (binary
stream) in a separate stream rather than embedded in the HTML stream.
If you are building a mobile application, installed on the device, then you are in the wrong forum but the concept is the same.
Member
8 Points
20 Posts
How to Reduce image(resize) base 64 image string below 64000 bytes
Jul 16, 2020 12:40 PM|Learning Rocks|LINK
Hello Everyone,
I have an image binary data(base64 encoded string) to show in android(mobile) device. Mobile device won't allow if it's size exceeds 64000 bytes. How to resize that image binary data(base 64 encoded string) to show in mobile using c# without exceeding 64000 bytes.
please share any reference to reduce base 64 encoded string of an image.
Thanks
All-Star
53001 Points
23587 Posts
Re: How to Reduce image(resize) base 64 image string below 64000 bytes
Jul 16, 2020 12:57 PM|mgebhard|LINK
A Base64 encoded images is larger than the original image by over 1/3. It is better to use the actual image file rather than converting to Base64.
If your aim is to learn how to manipulate image files using C# then read through the System.Drawing namespace.
https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image?view=dotnet-plat-ext-3.1
Member
8 Points
20 Posts
Re: How to Reduce image(resize) base 64 image string below 64000 bytes
Jul 16, 2020 01:07 PM|Learning Rocks|LINK
Hi,
But to show that image in android mobile device, it allows only Base64 Encoded string. This image data i am getting from MySql(blob field) db
All-Star
53001 Points
23587 Posts
Re: How to Reduce image(resize) base 64 image string below 64000 bytes
Jul 16, 2020 01:27 PM|mgebhard|LINK
That's not true.
Images are Base64 encoded when the image is embed in an HTML response since HTML is text based. If this is a browser based application then use a handler or Action, depending on the type of application, to allow the browser to download the file (binary stream) in a separate stream rather than embedded in the HTML stream.
If you are building a mobile application, installed on the device, then you are in the wrong forum but the concept is the same.
All-Star
194434 Points
28074 Posts
Moderator
Re: How to Reduce image(resize) base 64 image string below 64000 bytes
Jul 16, 2020 01:28 PM|Mikesdotnetting|LINK