PreViewWindow.cs 757 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace UAS_LabelMachine
  10. {
  11. public partial class PreViewWindow : Form
  12. {
  13. string FileName;
  14. public PreViewWindow(string filename)
  15. {
  16. InitializeComponent();
  17. FileName = filename;
  18. }
  19. private void PreViewWindow_Load(object sender, EventArgs e)
  20. {
  21. LabelPreView.Image = Image.FromFile(@"C:\打印标签\"+FileName+".jpg");
  22. }
  23. private void PreViewWindow_FormClosed(object sender, FormClosedEventArgs e)
  24. {
  25. LabelPreView.Image = null;
  26. }
  27. }
  28. }