示例#1
0
        public override void StartDownload()
        {
            Directory.CreateDirectory(Path.GetDirectoryName(m_localFilePath));
            Tile.IsDownloadingImage = true;

            if (m_dArtificialZoom >= 2.0)
            {
                Tile.IsDownloadingImage = false;

                using (Bitmap b = new Bitmap(256, 256))
                {
                    using (Graphics g = Graphics.FromImage(b))
                    {
                        using (Font f = new Font(FontFamily.GenericSansSerif, 16.0f))
                        {
                            g.DrawString("One or more layers are not visible at this scale", f, Brushes.White, new RectangleF(0, 0, 256, 128), new StringFormat()
                            {
                                Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center
                            });
                            g.DrawString("Zoom in further\nto enable them", f, Brushes.White, new RectangleF(0, 128, 256, 128), new StringFormat()
                            {
                                Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center
                            });
                        }
                        g.DrawRectangle(Pens.Green, new Rectangle(0, 0, 255, 255));
                    }
                    b.Save(m_localFilePath, System.Drawing.Imaging.ImageFormat.Png);
                }
                m_tile.TileSet.RemoveFromDownloadQueue(this, true);
            }
            else
            {
                download = new ArcIMSImageDownload(m_imageStore as ArcIMSImageStore, new Geosoft.Dap.Common.BoundingBox(Tile.East, Tile.North, Tile.West, Tile.South), 0, m_oCultureInfo, m_dArtificialZoom);
                download.DownloadType      = DownloadType.Unspecified;
                download.SavedFilePath     = m_localFilePath + ".tmp";
                download.ProgressCallback += new DownloadProgressHandler(UpdateProgress);
                download.CompleteCallback += new WorldWind.Net.DownloadCompleteHandler(DownloadComplete);
                download.BackgroundDownloadMemory();
            }
        }
示例#2
0
        public override void StartDownload()
        {
            Directory.CreateDirectory(Path.GetDirectoryName(m_localFilePath));
             Tile.IsDownloadingImage = true;

            if (m_dArtificialZoom >= 2.0)
            {
                Tile.IsDownloadingImage = false;

                using (Bitmap b = new Bitmap(256, 256))
                {
                    using (Graphics g = Graphics.FromImage(b))
                    {
                        using (Font f = new Font(FontFamily.GenericSansSerif, 16.0f))
                        {
                            g.DrawString("One or more layers are not visible at this scale", f, Brushes.White, new RectangleF(0, 0, 256, 128), new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
                            g.DrawString("Zoom in further\nto enable them", f, Brushes.White, new RectangleF(0, 128, 256, 128), new StringFormat() { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
                        }
                        g.DrawRectangle(Pens.Green, new Rectangle(0, 0, 255, 255));
                    }
                    b.Save(m_localFilePath, System.Drawing.Imaging.ImageFormat.Png);
                }
                m_tile.TileSet.RemoveFromDownloadQueue(this, true);
            }
            else
            {
                download = new ArcIMSImageDownload(m_imageStore as ArcIMSImageStore, new Geosoft.Dap.Common.BoundingBox(Tile.East, Tile.North, Tile.West, Tile.South), 0, m_oCultureInfo, m_dArtificialZoom);
                download.DownloadType = DownloadType.Unspecified;
                download.SavedFilePath = m_localFilePath + ".tmp";
                download.ProgressCallback += new DownloadProgressHandler(UpdateProgress);
                download.CompleteCallback += new WorldWind.Net.DownloadCompleteHandler(DownloadComplete);
                download.BackgroundDownloadMemory();
            }
        }