public static PictureSymbol FromImageFile(String path) { using (Image image = Image.FromFile(path)) { return(PictureSymbol.FromImage(image)); } }
public static PictureSymbol FromJson(String json) { PictureSymbol ret = new PictureSymbol(); ret._symbol = (PictureMarkerSymbol)Symbol.FromJson(json); return(ret); }
public static PictureSymbol FromImage(Image image) { using (MemoryStream ms = new MemoryStream()) { // Convert Image to byte[] image.Save(ms, image.RawFormat); byte[] imageBytes = ms.ToArray(); String imageData = Convert.ToBase64String(imageBytes); String jsonSymbol = GetPictureMarkerSymbolJson(imageData, GetImageMimeType(image.RawFormat), 0, image.Width, image.Height); return(PictureSymbol.FromJson(jsonSymbol)); } }