Convert Image to Base64

Source: Internet
Author: User


Ylbtech-unitity-cs:convert image to Base64

Convert Image to Base64

1.A, back to top
1.B, source code back to top
1.b.1,convert image to Base64
#regionConvert Image to Base64 Public stringImageToBase64 (image image, System.Drawing.Imaging.ImageFormat format) {using(MemoryStream ms =NewMemoryStream ()) {        //Convert Image to byte[]image.        Save (MS, format); byte[] Imagebytes =Ms.        ToArray (); //Convert byte[] to Base64 String        stringBase64string =convert.tobase64string (imagebytes); returnbase64string; }}#endregion
View Code

1.C, back to top

This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

Convert Image to Base64

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: