Answered by:
How to Reduce image(resize) base 64 image string below 64000 bytes

Question
-
User339833461 posted
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
Thursday, July 16, 2020 12:40 PM
Answers
-
User475983607 posted
Learning Rocks
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
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.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 16, 2020 1:27 PM -
User-821857111 posted
Hi,
But to show that image in android mobile device, it allows only Base64 Encoded string.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 16, 2020 1:28 PM
All replies
-
User475983607 posted
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
Thursday, July 16, 2020 12:57 PM -
User339833461 posted
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
Thursday, July 16, 2020 1:07 PM -
User475983607 posted
Learning Rocks
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
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.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 16, 2020 1:27 PM -
User-821857111 posted
Hi,
But to show that image in android mobile device, it allows only Base64 Encoded string.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, July 16, 2020 1:28 PM