public override void Load() { return; string strCachePath = GetCachePath(); if (m_oImageTileService == null && m_strDataSetName != string.Empty && m_strServerUrl != string.Empty) { m_oImageTileService = new ImageTileService(m_strDataSetName, m_strServerUrl); } m_oImageAccessor = new ImageAccessor(strCachePath, m_intTextureSizePixels, m_decLevelZeroTileSizeDegrees, m_intNumberLevels, m_strImageFileExtension, strCachePath, m_oImageTileService); m_oQuadTileSet = new QuadTileSet(m_strName, m_hBoundary, m_oWorld, distAboveSurface, (terrainMapped ? m_oWorld.TerrainAccessor : null), m_oImageAccessor, m_bOpacity, false); base.Load(); }
public void Render(DrawArgs drawArgs) { const int screenMargin = 10; m_renderPosition = new Vector2(drawArgs.screenWidth - HalfWidth - screenMargin, drawArgs.screenHeight - screenMargin); ImageAccessor logoAccessor = null; // 显示下载进度条 for (int i = 0; i < DrawArgs.DownloadQueue.ActiveDownloads.Count; i++) { DownloadRequest request = (DownloadRequest)DrawArgs.DownloadQueue.ActiveDownloads[i]; GeoSpatialDownloadRequest geoRequest = request as GeoSpatialDownloadRequest; if (geoRequest == null) { continue; } RenderProgress(drawArgs, geoRequest); RenderRectangle(drawArgs, geoRequest); ImageTileRequest imageRequest = geoRequest as ImageTileRequest; if (imageRequest == null) { continue; } QuadTile qt = imageRequest.QuadTile; if (qt.QuadTileArgs.ImageAccessor.ServerLogoPath != null) { logoAccessor = qt.QuadTileArgs.ImageAccessor; } } if (logoAccessor != null) { RenderLogo(drawArgs, logoAccessor); } }
private static Section CreateSection( this IReadOnlyCollection <OpenXml.OpenXmlCompositeElement> xmlElements, Word.SectionProperties wordSectionProperties, Pack.MainDocumentPart mainDocumentPart, HeaderFooterConfiguration headerFooterConfiguration, bool isFirst, IStyleFactory styleFactory) { var imageAccessor = new ImageAccessor(mainDocumentPart); var sectionProperties = wordSectionProperties.CreateSectionProperties(mainDocumentPart, isFirst, headerFooterConfiguration); var columnsConfiguration = wordSectionProperties.CreateColumnsConfiguration(sectionProperties.PageConfiguration, sectionProperties.Margin); var sectionContents = xmlElements.SplitToSectionContents(columnsConfiguration, imageAccessor, styleFactory); var sd = new Section(sectionProperties, sectionContents, imageAccessor, styleFactory); return(sd); }
/// <summary> /// Renders the server logo /// </summary> /// <param name="logoAccessor"></param> protected void RenderLogo(DrawArgs drawArgs, ImageAccessor logoAccessor) { if (logoAccessor.ServerLogoPath == null) { return; } if (logoAccessor.ServerLogo == null) { if (!File.Exists(logoAccessor.ServerLogoPath)) { return; } logoAccessor.ServerLogo = ImageHelper.LoadTexture(drawArgs.device, logoAccessor.ServerLogoPath); using (Surface s = logoAccessor.ServerLogo.GetSurfaceLevel(0)) { SurfaceDescription desc = s.Description; logoAccessor.ServerLogoSize = new Rectangle(0, 0, desc.Width, desc.Height); } } if (m_sprite == null) { m_sprite = new Sprite(drawArgs.device); } float xScale = 2f * HalfWidth / logoAccessor.ServerLogoSize.Width; float yScale = 2f * HalfWidth / logoAccessor.ServerLogoSize.Height; m_renderPosition.Y -= HalfWidth; m_sprite.Begin(SpriteFlags.AlphaBlend); m_sprite.Transform = Matrix.Scaling(xScale, yScale, 0); m_sprite.Transform *= Matrix.Translation(m_renderPosition.X, m_renderPosition.Y, 0); m_sprite.Draw(logoAccessor.ServerLogo, new Vector3(logoAccessor.ServerLogoSize.Width >> 1, logoAccessor.ServerLogoSize.Height >> 1, 0), Vector3.Empty, World.Settings.downloadLogoColor); m_sprite.End(); }
public override void Load() { string name = "Geocover 1990"; string description = "NASA derived global 30 meters per pixel satellite image mosaic"; //////////////////////////--------------- double north = 90.0; double south = -90.0; double west = -180.0; double east = 180.0; GeographicBoundingBox box = new GeographicBoundingBox(north, south, west, east); ///////////////////////////--------------------- string m_strDataSetName = "bmng.topo.bathy.200403"; string m_strServerUrl = "http://worldwind25.arc.nasa.gov/tile/tile.aspx"; ImageTileService m_oImageTileService = new ImageTileService(m_strDataSetName, m_strServerUrl); //////////////////////////------------------------------- decimal m_decLevelZeroTileSizeDegrees = 36.0m; int m_intNumberLevels = 20; int m_intTextureSizePixels = 256; string m_strImageFileExtension = "jpg"; string strCachePath = @"E:\项目\智岩切片工具\分块数据\DomTile";// Config.EarthSetting.CachePath + "\\bmng\\"; ImageAccessor m_oImageAccessor = new ImageAccessor(strCachePath, m_intTextureSizePixels, m_decLevelZeroTileSizeDegrees, m_intNumberLevels, m_strImageFileExtension, strCachePath, m_oImageTileService); QuadTileSet tile = new QuadTileSet(name, box, this.Viewer.CurrentWorld, 0, this.Viewer.CurrentWorld.TerrainAccessor, m_oImageAccessor, m_bOpacity, true); tile.IsVisible = true; this.Viewer.CurrentWorld.RenderLayerList.Add(tile); }
public void SetNonreusableImage(SySal.Imaging.LinearMemoryImage lmi) { lock (this) { m_OriginalBmp = new Bitmap(lmi.Info.Width, lmi.Info.Height, lmi.Info.Width, System.Drawing.Imaging.PixelFormat.Format8bppIndexed, ImageAccessor.Scan(lmi)); m_OriginalBmp.Palette = GrayScalePalette; m_Bmp = new Bitmap(pbScreen.Width, pbScreen.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb); } this.Invoke(new dVoid(delegate() { lock (this) { pbScreen.Image = m_Bmp; m_G = System.Drawing.Graphics.FromImage(m_Bmp); m_G.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; m_G.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed; m_G.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; double fzoom = m_Bmp.Width * m_Zoom / m_OriginalBmp.Width; m_G.DrawImage(m_OriginalBmp, new Rectangle(0, 0, m_Bmp.Width, m_Bmp.Height), new Rectangle((int)((m_OriginalBmp.Width - m_Bmp.Width / fzoom) * 0.5), (int)((m_OriginalBmp.Height - m_Bmp.Height / fzoom) * 0.5), (int)(m_Bmp.Width / fzoom), (int)(m_Bmp.Height / fzoom)), GraphicsUnit.Pixel); } } )); }