Showing posts with label and. Show all posts
Showing posts with label and. Show all posts

Monday, October 1, 2012

Convert Image to Base64 String and Base64 String to Image

Convert Image to Base64 String and Base64 String to Image

Learn how to convert Image to Base64 String and Base64 String to Image. (Online Converter Image to Base64)

Online Converter Image to Base64
This article will help you to learn how we can convert an image into a base64 string and base64 string back to image.

Image to Base64 String

public string ImageToBase64(Image image, 
  System.Drawing.Imaging.ImageFormat format)
{
  using (MemoryStream ms = new MemoryStream())
  {
    // Convert Image to byte[]
    image.Save(ms, format);
    byte[] imageBytes = ms.ToArray();

    // Convert byte[] to Base64 String
    string base64String = Convert.ToBase64String(imageBytes);
    return base64String;
  }
}

Base64 String to Image

public Image Base64ToImage(string base64String)
{
  // Convert Base64 String to byte[]
  byte[] imageBytes = Convert.FromBase64String(base64String);
  MemoryStream ms = new MemoryStream(imageBytes, 0, 
    imageBytes.Length);

  // Convert byte[] to Image
  ms.Write(imageBytes, 0, imageBytes.Length);
  Image image = Image.FromStream(ms, true);
  return image;
}

C# | Utility

Information Courtesy : http://www.dailycoding.com/Posts/convert_image_to_base64_string_and_base64_string_to_image.aspx

Wednesday, February 29, 2012

Advantages and Disadvantages of Decision Tables / Decision Trees

Decision Table(MATRIX) Advantages

Help the Analyst to ensure the completeness and the accuracy.

Decision Tree Advantages 


Easy to understand 
Map nicely to a set of business rules 
Applied to real problems 
Make no prior assumptions about the data 
Able to process both numerical and categorical data 

Decision Tree Disadvantages 

Output attribute must be categorical 
Limited to one output attribute 
Decision tree algorithms are unstable 
Trees created from numeric datasets can be complex