Hi,
I think I'd try this:vb.NET Code:
Syntax Visual Basic (Declaration) Public Class InputImageFile _ Implements IDisposable Examples The following example demonstrates usage of InputImageFile class. The code collects all JPEG images from the specifed directory and prepares them for watermarking. try { Watermarker w = new Watermarker("demo", "demo"); List<InputImageFile> inputImages = new List<InputImageFile>(); string[] imageFiles = System.IO.Directory.GetFiles("c:\\Family\\Photo\\unsorted", "*.jpg", System.IO.SearchOption.AllDirectories); foreach (string filename in imageFiles) { w.InputImages.Add(new InputImageFile(filename, Path.GetFileName(filename)); } } catch (System.Exception e) { MessageBox.Show(e.Message); } Syntax Visual Basic (Declaration) Public Class TextWatermark _ Inherits WatermarkBase Examples The following example demonstrates usage of TextWatermark class. try { Watermarker w = new Watermarker("demo", "demo"); w.AddInputFile("c:\\temp\\input\\image1.jpg", "image1_watermarked.jpg"); TextWatermark twm = new TextWatermark() With twm .Text = "Copyright © John Doe, 2008"; .Font = new WatermarkFont("Arial", FontStyle.Bold, FontSizeType.Percents, 2); .TextColor = Color.Red; .Transparency = 40; .Alignment = TextAlignment.Center; .Placement = WatermarkPlacement.BottomRight; .Margins = new WatermarkMargins(20, 20, 20, 20); End With w.AddWatermark(twm) w.OutputOptions.OutputDirectory = "c:\\temp\\output"; w.Execute(); } catch (System.Exception e) { MessageBox.Show(e.Message); }
Poppa




Reply With Quote
