Exemple #1
0
        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);
        }
Exemple #2
0
 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));
     }
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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;
                }
            }
        }
Exemple #5
0
 private void ShowProperty(string file)
 {
     this.lblCompressType.Text = TiffCreator.GetTiffFormatName(file);
 }