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 Image[] GetImage(string filepath) { using (System.IO.FileStream stream = new System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { Image tiffImg = Image.FromStream(stream); return(TiffCreator.GetImages(tiffImg)); } }
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); }
private void button6_Click(object sender, EventArgs e) { openFileDialog1.Multiselect = false; if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string file = openFileDialog1.FileName; string ext = Path.GetExtension(file); switch (ext.ToLower()) { case ".tif": TiffCreator.SlipTiffFile(file); break; case ".pdf": string tiffile = TiffCreator.SlipPfdfFile(file); TiffCreator.SlipTiffFile(tiffile); break; } } }
private void ShowProperty(string file) { this.lblCompressType.Text = TiffCreator.GetTiffFormatName(file); }