Every ByteScout tool contains example VB.NET source codes that you can find here or in the folder with installed ByteScout product. ByteScout Watermarking SDK was made to help with resize image in actual units in VB.NET. ByteScout Watermarking SDK is the software development kit that helps to quickly implement adding of watermarks on top of PNG, JPG, BMP images as well as on multipaged TIFF files. You may select ready to use presets or create your own preset with semitransparent logo images, text lines with adjustable font size, family, color, rotation.
VB.NET code snippet like this for ByteScout Watermarking SDK works best when you need to quickly implement resize image in actual units in your VB.NET application. In order to implement this functionality, you should copy and paste code below into your app using code editor. Then compile and run your application. You can use these VB.NET sample examples in one or many applications.
On our website you may get trial version of ByteScout Watermarking SDK for free. Source code samples are included to help you with your VB.NET application.
Imports System Imports System.Diagnostics Imports System.Drawing Imports System.Collections.Generic Imports Bytescout.Watermarking Imports Bytescout.Watermarking.Presets Module Tutorial Sub Main(ByVal args As String()) ' Create Watermarker instance Dim waterMarker As New Watermarker() ' Initialize library waterMarker.InitLibrary("demo", "demo") ' Set input file name Dim inputFilePath As String = "my_sample_image.jpg" ' Set output file title Dim outputFilePath As String = "my_sample_output.jpg" ' Add image to apply watermarks to waterMarker.AddInputFile(inputFilePath, outputFilePath) ' Allow resize waterMarker.OutputOptions.Resize = True ' Set resize type to percentage waterMarker.OutputOptions.ResizeType = ResizeType.Actual ' Set units type waterMarker.OutputOptions.ResizeActualUnits = ActualSizeUnits.inches ' Set image width waterMarker.OutputOptions.ResizeWidthInUnits = 1.5F ' Set image height waterMarker.OutputOptions.ResizeHeightInUnits = 2.0F ' Set output directory waterMarker.OutputOptions.OutputDirectory = "." ' Apply watermarks waterMarker.Execute() ' open generated image file in default image viewer installed in Windows Process.Start(outputFilePath) End Sub End Module