Пример #1
0
		/// <summary>
		/// Convert if requested and prepare downloaded data for display
		/// </summary>
		private void ProcessDownloadedImage(WMSDownload wdl, Stream dataStream)
		{
			try
			{
				string ddsFile = wdl.SavedFilePath + ".dds";
				if( wdl.Date.Length>0)
					UpdateStatusBar( "Converting " + wdl.Date );
				else
					UpdateStatusBar( "Converting... " );
				Directory.CreateDirectory(Path.GetDirectoryName(wdl.SavedFilePath));
				if (dataStream.Length==0)
					throw new WebException("Server returned no data.");
				ImageHelper.ConvertToDxt3(dataStream, ddsFile );
				if(this.animationState == AnimationState.Cancel || animationState == AnimationState.Stop)
					return;
		
				ImageLayerInfo imageLayerInfo = new ImageLayerInfo(wdl);
				imageLayerInfo.Save(wdl.SavedFilePath + ".wwi");
				lock(this.animationFrames.SyncRoot)
					animationFrames.Add(imageLayerInfo);
				
				if(this.animationState == AnimationState.Cancel || this.animationState == AnimationState.Stop)
					return;

				UpdateStatusBar( "" );
			}
			catch(Exception caught)
			{
				this.worldWindow.Caption = caught.Message;
				Log.Write( caught );
			}
		}