Watermark an image
How to watermark an image by adding label on drag and drop at design and save the image atlast..... Any idea guys. Pl Help me soon
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
paul daniel189 reputationPosted Jan 12, 2010, 2:47 AM EST
2) Create new "Web-Site" project using Project Wizard
3) Click "Website" menu and then "Add Reference" command in this menu
4) "Add Reference" dialog will appear. Select "Bytescout.Watermarking.dll" and click OK to add a reference to Bytescout.Watermarking SDK component
5) Then copy and paste the following code into the "Default.aspx.cs" file (see below)
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Bytescout.Watermarking;
using Bytescout.Watermarking.Presets;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Create Watermarker instance
Watermarker waterMarker = new Watermarker();
// Initialize library
waterMarker.InitLibrary("demo", "demo");
// Set input file name
string inputFilePath = "my_sample_image.jpg";
// Add image to apply watermarks to
waterMarker.AddInputFile(inputFilePath);
// Create new watermark
TextFitsPage preset = new TextFitsPage();
// Set watermark text
// Add watermark to watermarkerpreset.Text = "Bytescout Watermarking";
waterMarker.AddWatermark(preset);
// clear http output
Response.Clear();
// set the content type to JPEG
Response.ContentType = "image/jpeg";
// add content type header
Response.AddHeader("Content-Type", "image/jpeg");
// set the content disposition
Response.AddHeader("Content-Disposition", "inline;filename=my_sample_image.jpg");
// Set output directory
waterMarker.OutputOptions.OutputStream = Response.OutputStream;
// Apply watermarks
waterMarker.Execute(0);
Response.End();
}
}
Kip HackmanRank #2,595 · 536 reputationPosted Nov 17, 2020, 5:24 AM EST