/// <summary> /// Converts an SwiftBitmap to a base64 string and returns it /// </summary> /// <param name="desiredFormat">Desired SwiftBitmap format (defaults to Jpeg)</param> /// <returns>The SwiftBitmap in base64 string format</returns> public string ToString(ImageFormat desiredFormat) { Contract.Requires <NullReferenceException>(InternalBitmap != null); desiredFormat = desiredFormat.Check(ImageFormat.Jpeg); using (MemoryStream Stream = new MemoryStream()) { InternalBitmap.Save(Stream, desiredFormat); return(Stream.ToArray().ToString(Base64FormattingOptions.None)); } }