/// <summary> /// Save the generated file as a raw file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void IL2Save(object sender, RoutedEventArgs e) { if (bitmap != null) { var dialog = new Microsoft.Win32.SaveFileDialog(); dialog.InitialDirectory = SRTMdirectory; dialog.Title = "Save generated image"; dialog.Filter = "IL2 files (*.tga)|*.tga"; if (dialog.ShowDialog() == true) { Mouse.OverrideCursor = Cursors.Wait; IL2Mapping map = new IL2Mapping(); IL2Colour[] newPixels = new IL2Colour[settings.ImageWidth * settings.ImageHeight]; for (int i = 0; i < settings.ImageHeight * settings.ImageWidth; i++) { newPixels[i] = map.GetColour(Pixels[i]); } TGAWriter.Save(newPixels, settings.ImageWidth, settings.ImageHeight, dialog.FileName); Mouse.OverrideCursor = null; } } }
public void IL2Save(string path) { IL2Mapping map = new IL2Mapping(); IL2Colour[] newPixels = new IL2Colour[settings.ImageWidth * settings.ImageHeight]; for (int i = 0; i < settings.ImageHeight * settings.ImageWidth; i++) { newPixels[i] = map.GetColour(Pixels[i]); } TGAWriter.Save(newPixels, settings.ImageWidth, settings.ImageHeight, path); }
/// <summary> /// Save map T pressed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveMapT(object sender, RoutedEventArgs e) { var dialog = new Microsoft.Win32.SaveFileDialog(); dialog.InitialDirectory = SRTMdirectory; dialog.Title = "Save generated type map"; dialog.Filter = "TGA files (*.tga)|*.tga"; if (dialog.ShowDialog() == true) { TGAWriter.Save(map_t, settings.ImageWidth, settings.ImageHeight, dialog.FileName); } }
/// <summary> /// Save the generated file as a tga /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TGASave(object sender, RoutedEventArgs e) { if (bitmap != null) { var dialog = new Microsoft.Win32.SaveFileDialog(); dialog.InitialDirectory = SRTMdirectory; dialog.Title = "Save generated image"; dialog.Filter = "TGA files (*.tga)|*.tga"; if (dialog.ShowDialog() == true) { TGAWriter.Save(Pixels, settings.ImageWidth, settings.ImageHeight, dialog.FileName); } } }
public void SaveMapT(string path) { TGAWriter.Save(map_t, settings.ImageWidth, settings.ImageHeight, path); }