ByteScout Watermarking SDK - VB.NET - Add and Show Progress Indicator - ByteScout

ByteScout Watermarking SDK – VB.NET – Add and Show Progress Indicator

  • Home
  • /
  • Articles
  • /
  • ByteScout Watermarking SDK – VB.NET – Add and Show Progress Indicator

How to add and show progress indicator in VB.NET and ByteScout Watermarking SDK

Write code in VB.NET to add and show progress indicator with this step-by-step tutorial

Learn how to add and show progress indicator in VB.NET with this source code sample. Want to add and show progress indicator in your VB.NET app? ByteScout Watermarking SDK is designed for it. ByteScout Watermarking SDK is the library for software developers that can be used to quickly add image watermarking features into your web or desktop applications. Use ready to use presets or create your own to be applied for input PNG, JPG, BMP images. Can customize fonts, text position and rotation if required.

You will save a lot of time on writing and testing code as you may just take the VB.NET code from ByteScout Watermarking SDK for add and show progress indicator below and use it in your application. Just copy and paste the code into your VB.NET application’s code and follow the instruction. Enjoy writing a code with ready-to-use sample VB.NET codes.

Trial version of ByteScout Watermarking SDK is available for free. Source code samples are included to help you with your VB.NET app.

Try it today: Get 60 Day Free Trial or sign up for Web API

Program.vb
      
Imports System.IO Imports Bytescout.Watermarking Imports Bytescout.Watermarking.Presets Class Program Friend Shared Sub Main(args As String()) ' Create Watermarker instance Dim waterMarker As New Watermarker() ' Initialize library waterMarker.InitLibrary("demo", "demo") ' Add images to apply watermarks to waterMarker.AddInputFile("image1.jpg", "image1_watermarked.jpg") waterMarker.AddInputFile("image2.jpg", "image2_watermarked.jpg") waterMarker.AddInputFile("image3.jpg", "image3_watermarked.jpg") ' Create new watermark Dim preset As New TextFitsPage() ' Set watermark text preset.Text = "My Watermark (c) Me 2010" ' Add watermark to watermarker waterMarker.AddWatermark(preset) ' Add Progress event handler AddHandler waterMarker.Progress, New ProgressEventHandler(AddressOf waterMarker_Progress) ' Apply watermarks waterMarker.Execute() Console.WriteLine() Console.WriteLine("Hit any key...") Console.ReadKey() End Sub Private Shared Sub waterMarker_Progress(percent As Double, status As String, processedFile As String, ByRef abort As Boolean) Dim message As String If Not String.IsNullOrEmpty(processedFile) Then message = String.Format("{0}: {1}: {2:f02}%", Path.GetFileName(processedFile), status, percent) Else message = String.Format("{0}: {1:f02}%", status, percent) End If Console.WriteLine(message.PadRight(Console.WindowWidth)) End Sub End Class

Try it today: Get 60 Day Free Trial or sign up for Web API

ProgressIndicator.Converted.VS2005.vbproj
      
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{B819C98B-70F4-459D-B45A-C81989CBE16D}</ProjectGuid> <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProgressIndicator</RootNamespace> <AssemblyName>ProgressIndicator</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG,TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" /> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Reference Include="Bytescout.Watermarking, Version=2.4.1.118, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Xml" /> <Compile Include="Program.vb" /> <Compile Include="Properties\AssemblyInfo.vb" /> <Content Include="image1.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image2.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image3.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

ProgressIndicator.Converted.VS2008.vbproj
      
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{B819C98B-70F4-459D-B45A-C81989CBE16D}</ProjectGuid> <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProgressIndicator</RootNamespace> <AssemblyName>ProgressIndicator</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG,TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" /> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Reference Include="Bytescout.Watermarking, Version=2.4.1.118, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Xml" /> <Compile Include="Program.vb" /> <Compile Include="Properties\AssemblyInfo.vb" /> <Content Include="image1.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image2.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image3.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

ProgressIndicator.Converted.VS2010.vbproj
      
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{B819C98B-70F4-459D-B45A-C81989CBE16D}</ProjectGuid> <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProgressIndicator</RootNamespace> <AssemblyName>ProgressIndicator</AssemblyName> <OldToolsVersion>3.5</OldToolsVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG,TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.Targets" /> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Reference Include="Bytescout.Watermarking, Version=2.4.1.118, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Xml" /> <Compile Include="Program.vb" /> <Compile Include="Properties\AssemblyInfo.vb" /> <Content Include="image1.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image2.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image3.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

ProgressIndicator.Converted.vbproj
      
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{B819C98B-70F4-459D-B45A-C81989CBE16D}</ProjectGuid> <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProgressIndicator</RootNamespace> <AssemblyName>ProgressIndicator</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG,TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" /> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Reference Include="Bytescout.Watermarking, Version=2.4.1.118, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Xml" /> <Compile Include="Program.vb" /> <Compile Include="Properties\AssemblyInfo.vb" /> <Content Include="image1.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image2.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="image3.jpg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout Watermarking SDK page

Explore ByteScout Watermarking SDK documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next