Dear all Master,
I'm a newbie on vb.net.
I need help converting the code below to vb.net and also teach me how to run the code properly in vb.net.
If there is a misunderstanding, you can ask me. For the record I'm using vs 2010. to run the process requires a library. You can request me so I share the
demo library.
Thanks
roy88
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(); twm.Text = "Copyright © John Doe, 2008"; twm.Font = new WatermarkFont("Arial", FontStyle.Bold, FontSizeType.Percents, 2); twm.TextColor = Color.Red; twm.Transparency = 40; twm.Alignment = TextAlignment.Center; twm.Placement = WatermarkPlacement.BottomRight; twm.Margins = new WatermarkMargins(20, 20, 20, 20); w.AddWatermark(twm); w.OutputOptions.OutputDirectory = "c:\\temp\\output"; w.Execute(); } catch (System.Exception e) { MessageBox.Show(e.Message); }




Reply With Quote
