public void SetImage(ClassImage obj) { MapClass map = new MapClass(); MemoryStream stream = new MemoryStream(); map.PicUrl = obj.PicUrl; obj.PicImage.Save(stream, ImageFormat.Png); map.Stream = stream.ToArray(); stream.Close(); Delete(obj.PicUrl); db.Get(map); db.Commit(); }
internal void Delete(string p) { MapClass map = new MapClass(); map.PicUrl = p; IObjectSet result = db.Get(map); foreach (MapClass obj in result) { db.Delete(obj); } }
private void downloadcomplete(MapClass obj) { if (gispainter != null) { ClassImage img = FindImage(obj.PicUrl); if (img != null) { if (obj.Stream != null) { img.PicImage = Bitmap.FromStream(new MemoryStream(obj.Stream)); //DataHelper.GetImage(obj.PicUrl).PicImage; } if (Invalidate != null) { Invalidate(new Rectangle(img.Left, img.Top, 200, 200), true); } } } }