@@ -235,36 +235,72 @@ private void ImportSVGToolStripMenuItem_Click(object sender, EventArgs e)
235235
236236 private void ExportSVGToolStripMenuItem_Click ( object sender , EventArgs e )
237237 {
238- using var dialog = new SaveFileDialog ( )
238+ var options = new string [ ]
239239 {
240- AddExtension = true ,
241- AutoUpgradeEnabled = true ,
242- CheckPathExists = true ,
243- DefaultExt = ".svg" ,
244- Filter = "Scalable Vector Graphics Files|*.svg|Any Files|*.*" ,
245- FileName = this . Vector . CollectionName ,
246- OverwritePrompt = true ,
247- SupportMultiDottedExtensions = true ,
248- Title = "Select filename where vector should be exported" ,
240+ "512x512" ,
241+ "1024x1024" ,
242+ "2048x2048" ,
243+ "4096x4096" ,
244+ "8192x8192" ,
245+ "16384x16384" ,
246+ "32768x32768" ,
247+ "65536x65536" ,
249248 } ;
250249
251- if ( dialog . ShowDialog ( ) == DialogResult . OK )
250+ var resolutions = new int [ ]
252251 {
252+ 512 ,
253+ 1024 ,
254+ 2048 ,
255+ 4096 ,
256+ 8192 ,
257+ 16384 ,
258+ 32768 ,
259+ 65536 ,
260+ } ;
253261
254- try
262+ var description = "Select resolution in which vector vinyl should be exported" ;
263+
264+ using ( var selection = new Prompt . Combo ( options , description , false ) )
265+ {
266+
267+ if ( selection . ShowDialog ( ) == DialogResult . OK )
255268 {
269+
270+ using var dialog = new SaveFileDialog ( )
271+ {
272+ AddExtension = true ,
273+ AutoUpgradeEnabled = true ,
274+ CheckPathExists = true ,
275+ DefaultExt = ".svg" ,
276+ Filter = "Scalable Vector Graphics Files|*.svg|Any Files|*.*" ,
277+ FileName = this . Vector . CollectionName ,
278+ OverwritePrompt = true ,
279+ SupportMultiDottedExtensions = true ,
280+ Title = "Select filename where vector should be exported" ,
281+ } ;
256282
257- var svg = this . Vector . GetSVGString ( 4096 ) ;
258- File . WriteAllText ( dialog . FileName , svg ) ;
259- MessageBox . Show ( $ "Vector { this . Vector . CollectionName } has been successfully exported.", "Info" ,
260- MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
283+ if ( dialog . ShowDialog ( ) == DialogResult . OK )
284+ {
261285
286+ try
287+ {
262288
263- }
264- catch ( Exception ex )
265- {
289+ var svg = this . Vector . GetSVGString ( resolutions [ selection . Value ] ) ;
290+ File . WriteAllText ( dialog . FileName , svg ) ;
291+ MessageBox . Show ( $ "Vector { this . Vector . CollectionName } has been successfully exported.", "Info" ,
292+ MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
266293
267- MessageBox . Show ( ex . GetLowestMessage ( ) , "Error" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
294+
295+ }
296+ catch ( Exception ex )
297+ {
298+
299+ MessageBox . Show ( ex . GetLowestMessage ( ) , "Error" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
300+
301+ }
302+
303+ }
268304
269305 }
270306
0 commit comments