Пример #1
0
		public ConversionOptions (FormatDescription format, bool a, string cs)
		{
			this.Format = format;
			this.SaveAlpha =a;
			this.Colorspace =cs;
		}
Пример #2
0
		public void FileSave( string output_file, bool save_alpha, string color_space, FormatDescription fmt)
		{
			Tracing.StartMethodTrace();

			this.VerifyAlive();
			this.VerifyNoDialogs();
			this.VerifyDocumentCount(1);

			WindowsAutomation.IO.VerifyFileDoesNotExist( output_file );

			WindowsAutomation.UI.Menu_Select( this.m_painter, "file", "save as..." );

			// We know the command succeeded if the SaveAs dialog is up

			int the_dialog = this.WaitForDialogToAppear( WindowTextEnum.SaveAsWindowText );
			this.Sleep(500);

			int the_combobox = UI.GetChildEx( the_dialog, 0, WindowClassEnum.ComboBoxWindowClass , null, WindowTextEnum.RIFFFilesWindowText  , 0) ;
			WindowsAutomation.UI.ComboBox_SelectItem( the_combobox, fmt.FilenameExtension );

			this.Sleep( 500 );

			int eb = UI.GetChild( the_dialog, WindowClassEnum.EditFieldWindowClass , null ) ;
			UI.SetTextRaw( eb, output_file );
			this.Sleep( 500 );

			if ( save_alpha == true )
			{
				int save_alpha_control = UI.GetChild( the_dialog, WindowClassEnum.ButtonWindowClass , WindowTextEnum.SaveAlphaWindowText ) ;
				System.Windows.Forms.SendKeys.SendWait( "+" ); // Use this key to always set the value regardless of its initial state
				this.Sleep( 500 );
			}

			int SAVE_button= UI.GetChild( the_dialog , WindowClassEnum.ButtonWindowClass, WindowTextEnum.SaveButtonWindowText );
			UI.LeftClick( SAVE_button );

			this.WaitForDialogToDisappear( the_dialog );

			// This section handles the Layer warning dialog and the tif export options dialog
			// The layer warning dialog only appears (when layers need to be collapsed)
			// The export options dialog appears every time

			this.Sleep(500);
			this.HandleLayerWarningDialog( );
			this.Sleep(500);
			this.HandleExportOptions( color_space );
			this.Sleep(500);
		
			this.WaitForFileAccess( output_file );
			
			this.VerifyAlive();
			this.VerifyNoDialogs();
			this.VerifyDocumentCount(1);

			Tracing.EndMethodTrace();
		}