Exemple #1
0
 private void button6_Click(object sender, EventArgs e)
 {
     MessageBox.Show("Go to Photoshop. When you're done with the cropping, press Ctrl+Space to navigate to the next image.", "Alert", MessageBoxButtons.OK);
     closeAll();
     entries.Clear();
     foreach (string line in System.IO.File.ReadLines(csvPath))
     {
         var ss = line.Split(',');
         entries.Add(new recordEntry(ss[0], ss[1], ss[2], ss[3]));
     }
     currentEntryN = 0;
     currentEntry  = entries[currentEntryN];
     openFile(entries[currentEntryN]);
     //toolStripStatusLabel1.Text = "Initializing...";
     //count = entries.Count;
     //done = 0;
     //toolStripStatusLabel1.Text = done + " done of " + count;
     //toolStripProgressBar1.Maximum = count + 1;
     //toolStripProgressBar1.Minimum = 1;
     //toolStripProgressBar1.Value = 1;
     //foreach (var item in entries)
     //{
     //    saveAsJPG(item);
     //}
 }
Exemple #2
0
        doIt(recordEntry entry)
        {
            toolStripStatusLabel1.Text = done + " done of " + count + " - current entry: " + entry.Name;
            //foreach (ps.Document item in app.Documents)
            //item.Close();
            //app.Open(@"C:\Users\Kesava for VS\Documents\Untitled-1.psd");
            //app.ActiveDocument.ArtLayers.Add();
            closeAll();
            switch (entry.Desg)
            {
            case "coordinator":
                app.Open(TemplatePath + "\\coordinator.psd");
                break;

            case "volunteer":
                app.Open(TemplatePath + "\\volunteer.psd");
                break;

            default:
                MessageBox.Show("Undefined Designation. Please check csv. Errors are emminent.", "Error", MessageBoxButtons.OK);
                break;
            }
            foreach (ps.ArtLayer item in app.ActiveDocument.Layers)
            {
                if (item.Kind == ps.PsLayerKind.psTextLayer)
                {
                    item.TextItem.Contents = entry.Name;
                }
            }
            app.Open(imagePath + "\\" + entry.Id);
            var y = app.Documents;

            app.ActiveDocument = app.Documents[2];
            var test = app.ActiveDocument.Name;

            app.ActiveDocument.ArtLayers[1].Copy();
            app.ActiveDocument             = app.Documents[1];
            app.ActiveDocument.ActiveLayer = app.ActiveDocument.ArtLayers[app.ActiveDocument.ArtLayers.Count];
            app.ActiveDocument.Paste();
            //Add JPG in future
            //var saveOptions = new ps.JPEGSaveOptions();
            //saveOptions.EmbedColorProfile = true;
            //saveOptions.FormatOptions = ps.PsFormatOptionsType.psStandardBaseline;
            //saveOptions.Matte = ps.PsMatteType.psNoMatte;
            //saveOptions.Quality = 10;
            app.ActiveDocument.SaveAs(outputPath + "\\" + entry.Id + ".psd", new ps.PhotoshopSaveOptions(), true);
            toolStripProgressBar1.Value++;
            done++;
        }
Exemple #3
0
        public async Task saveAsJPG(recordEntry entry)
        {
            toolStripStatusLabel1.Text = done + " done of " + count + " - current entry: " + entry.Name;
            closeAll();
            openFile(entry);
            var saveOptions = new ps.JPEGSaveOptions();

            saveOptions.EmbedColorProfile = true;
            saveOptions.FormatOptions     = ps.PsFormatOptionsType.psStandardBaseline;
            saveOptions.Matte             = ps.PsMatteType.psNoMatte;
            saveOptions.Quality           = 10;
            app.ActiveDocument.SaveAs(outputPath + "\\" + entry.Id + ".jpg", saveOptions, true);
            toolStripProgressBar1.Value++;
            done++;
        }
Exemple #4
0
 private void openNext()
 {
     currentEntry = entries[currentEntryN];
     openFile(entries[currentEntryN]);
 }
Exemple #5
0
 private void openFile(recordEntry entry)
 {
     app.Open(outputPath + "\\" + entry.Id + ".psd");
 }