예제 #1
0
 public static PictureSymbol FromImageFile(String path)
 {
     using (Image image = Image.FromFile(path))
     {
         return(PictureSymbol.FromImage(image));
     }
 }
예제 #2
0
        public static PictureSymbol FromJson(String json)
        {
            PictureSymbol ret = new PictureSymbol();

            ret._symbol = (PictureMarkerSymbol)Symbol.FromJson(json);
            return(ret);
        }
예제 #3
0
        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));
            }
        }