Beispiel #1
0
        private void MapOnCache(ref GDIMap m)
        {
            //Bitmap b = new Bitmap();
            //Graphics g = Graphics.FromImage(b);

            //Rectangle r = new Rectangle(0, 0, m.Width, m.Height);

            //string ID = ClientID;

            //Size sz = ControlSize;

            //m.MapFrame.Print(g, r);


            Bitmap b = m.Draw();

            MemoryStream MS = new MemoryStream();

            b.Save(MS, System.Drawing.Imaging.ImageFormat.Png);
            byte[] buffer = MS.ToArray();
            HttpContext.Current.Cache.Insert((string)ViewState[ClientID], buffer, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1));


            //g.Dispose();
            b.Dispose();
        }
Beispiel #2
0
        private void MapOnCache(ref GDIMap m)
        {
            //Bitmap b = new Bitmap();
            //Graphics g = Graphics.FromImage(b);

            //Rectangle r = new Rectangle(0, 0, m.Width, m.Height);

            //string ID = ClientID;

            //Size sz = ControlSize;

            //m.MapFrame.Print(g, r);


            Bitmap b = m.Draw();

            MemoryStream MS = new MemoryStream();
            b.Save(MS, System.Drawing.Imaging.ImageFormat.Png);
            byte[] buffer = MS.ToArray();
            HttpContext.Current.Cache.Insert((string)ViewState[ClientID], buffer, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1));
           

            //g.Dispose();
            b.Dispose();

        }