private void SaveImage(string saveFile) { Image orgimg = (Bitmap)this.canvasPicture1.Image.Clone(); Image[] imgFrames = TiffCreator.GetImages(orgimg); List <Image> makeImgs = new List <Image>(); foreach (Image img in imgFrames) { Image makImg = new Bitmap(img); using (Graphics g = Graphics.FromImage(makImg)) { foreach (BarcodeFrame frame in this.canvasPicture1.Frames.Items) { if (frame.BarcodeImage != null) { g.DrawImage(frame.BarcodeImage, frame.StartPoint); } } } makeImgs.Add(makImg); } TiffCreator.TiffCompressType comType = TiffCreator.GetTiffFormat(orgimg); TiffCreator.CreateTiffImage(makeImgs.ToArray(), saveFile, comType); }
private void button2_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog(this) != System.Windows.Forms.DialogResult.OK) { return; } string saveFile = saveFileDialog1.FileName; List <Image> images = new List <Image>(); foreach (ListViewItem item in listView1.Items) { Image img = LoadedImages[item.ImageIndex]; images.Add(img); } string typename = (string)comboBox1.SelectedItem; TiffCreator.TiffCompressType comType = (TiffCreator.TiffCompressType)System.Enum.Parse(typeof(TiffCreator.TiffCompressType), typename); TiffCreator.CreateTiffImage(images.ToArray(), saveFile, comType); }