ByteScout Watermarking SDK - C# - Stamp - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Watermarking SDK – C# – Stamp

  • Home
  • /
  • Articles
  • /
  • ByteScout Watermarking SDK – C# – Stamp

ByteScout Watermarking SDK – C# – Stamp

Program.cs

using System;
using System.Diagnostics;
using System.Drawing;
using System.Collections.Generic;
using Bytescout.Watermarking;
using Bytescout.Watermarking.Presets;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create Watermarker instance
            Watermarker waterMarker = new Watermarker();

            // Initialize library
            waterMarker.InitLibrary("demo", "demo");

            // Set input file name
            string inputFilePath = "my_sample_image.jpg";

            foreach (string stampType in Stamp.PresetImages)
            {
                // Set output file title
                string outputFilePath = "my_sample_output_" + stampType + ".jpg";

                // Add image to apply watermarks to
                waterMarker.AddInputFile(inputFilePath, outputFilePath);

                // Set output directory
                waterMarker.OutputOptions.OutputDirectory = ".";

                // Create new watermark
                Stamp preset = new Stamp();

                // Set stamp type
                preset.ImageFile = stampType;

                // Add watermark to watermarker
                waterMarker.AddWatermark(preset);

                // Apply watermarks
                waterMarker.Execute();

                // Clear all settings
                waterMarker.Clear();
            }
        }
    }
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next