CINXE.COM
Watermark and Add Copyright Info to your Images on your Local drive using C# and VB.NET | DotNetCurry
<!DOCTYPE html> <html lang="en"> <head id="ctl00_Head1"><meta charset="utf-8" /><title> Watermark and Add Copyright Info to your Images on your Local drive using C# and VB.NET | DotNetCurry </title><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" /><meta name="description" content="Most of us, who run websites/blogs or host technical content, face issues of our images being copied and displayed on other blogs. One of the solutions to this problem is watermarking our images with our logo or watermarking the website name on the images.In this article, I will propose a desktop solution using Windows Forms, which can be used to watermark images before you upload the images to the site. " /><meta name="keywords" content="WinForms & WinRT" /><meta name="author" content="DotNetCurry.com" /><meta name="CCBot" content="nofollow" /><link rel="shortcut icon" href="img/favicon.ico" /><link rel="icon" type="image/ico" href="img/favicon.ico" /><link rel="stylesheet" href="js/font-awesome/css/font-awesome.min.css" /><link rel="canonical" href="https://www.dotnetcurry.com/ShowArticle.aspx?ID=243" /><link href="/content/site?v=dSwaMsW0iplPE-tk0JGVwhcZRf6VKKqSg-lTdPGvZso1" rel="stylesheet"/> <style>.async-hide { opacity: 0 !important} </style> <!-- GA disabled 17062020 --> <!--<script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')}; (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c; })(window,document.documentElement,'async-hide','dataLayer',4000, {'GTM-NJXQ5BG':true});</script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-2417460-4', 'auto'); ga('require', 'GTM-NJXQ5BG'); ga('send', 'pageview'); </script>--> <!-- Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '1902706389940870', { //em: 'insert_email_variable' }); fbq('track', 'PageView'); </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1902706389940870&ev=PageView&noscript=1" /></noscript> <!-- DO NOT MODIFY --> <!-- End Facebook Pixel Code --> <!-- Twitter universal website tag code May 30 17 --> <script> !function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments); },s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='//static.ads-twitter.com/uwt.js', a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script'); // Insert Twitter Pixel ID and Standard Event data below twq('init','nw0gz'); twq('track','PageView'); </script> <!-- End Twitter universal website tag code --> </head> <body> <form name="aspnetForm" method="post" action="./ShowArticle.aspx?ID=243" id="aspnetForm"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE0MDk2ODQwMTdkZJysVikQVHzjAtZqOeUvZO1Bu1pl" /> </div> <div> <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="A9C58E29" /> </div> <div class="wrapper"> <!-- header --> <header class="header header-megamenu"> <nav class="navbar navbar-default" role="navigation"> <div class="container"> <!--<div class="search-bar"> <input type="search" onkeyup="executeQuery();" placeholder="Type search text here..." name="search" id="search-keyword"> <div class="search-close" id="x"><i class="fa fa-times"></i></div> </div>--> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!--<a class="navbar-brand" href="./index.html"> <img src="img/dnc-logo-tee-trans.png" srcset="img/dnc-logo-small.jpg 1980w, img/dnc-logo-x-small.jpg 320w" sizes ="100vw" class="img-responsive" alt="DNC Magazine" /> </a>--> <a class="navbar-brand" href="https://www.dotnetcurry.com"> <img src="/img/dnc-logo-small.jpg" class="img-responsive" alt="DNC Magazine" /> </a> </div> <!--<div class="search-trigger pull-right"></div>--> <div class="navbar-social pull-right visible-xs-block, hidden-xs"> <a href="https://www.facebook.com/dotnetcurry"><img src="/img/icon/fb.png" class="img-responsive" alt="DotNetCurry's Official Facebook Account" /></a> <a href="https://www.twitter.com/dotnetcurry"><img src="/img/icon/twit.png" class="img-responsive" alt="DotNetCurry's Official Twitter Account" /></a> <a href="https://github.com/dotnetcurry"><img src="/img/icon/git.png" class="img-responsive" alt="DotNetCurry's Official Github Account" /></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li class="dropdown megamenu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorials <span class="fa fa-angle-down"></span></a> <ul class="dropdown-menu"> <li> <div class="row"> <div class="col-md-3"> <h5>ASP.NET</h5> <a href="https://www.dotnetcurry.com/tutorials/aspnet">ASP.NET</a> <a href="https://www.dotnetcurry.com/tutorials/aspnet-mvc">ASP.NET MVC</a> <a href="https://www.dotnetcurry.com/tutorials/aspnet-core">ASP.NET Core</a> <a href="https://www.dotnetcurry.com/tutorials/sharepoint">SharePoint</a> <a href="https://www.dotnetcurry.com/tutorials/aspnet-ajax" class="last">ASP.NET AJAX</a> <h5>Patterns and Practices</h5> <a href="https://www.dotnetcurry.com/tutorials/software-gardening">Software Gardening</a> <a href="https://www.dotnetcurry.com/tutorials/patterns-practices">Design Patterns</a> </div> <div class="col-md-3"> <h5>.NET</h5> <a href="https://www.dotnetcurry.com/tutorials/csharp">C#</a> <a href="https://www.dotnetcurry.com/tutorials/visualstudio">Visual Studio</a> <a href="https://www.dotnetcurry.com/tutorials/vsts-tfs">VSTS (Azure DevOps) & TFS</a> <a href="https://www.dotnetcurry.com/tutorials/linq">LINQ</a> <a href="https://www.dotnetcurry.com/tutorials/entityframework">Entity Framework</a> <a href="https://www.dotnetcurry.com/tutorials/dotnetframework">.NET Framework</a> <a href="https://www.dotnetcurry.com/tutorials/dotnet-standard-core">.NET Standard & .NET Core</a> <a href="https://www.dotnetcurry.com/tutorials/wpf">WPF</a> <a href="https://www.dotnetcurry.com/tutorials/wcf">WCF</a> <a href="https://www.dotnetcurry.com/tutorials/winforms">WinForms</a> </div> <div class="col-md-3"> <h5>Cloud and Mobile</h5> <a href="https://www.dotnetcurry.com/tutorials/windows-azure">Microsoft Azure</a> <a href="https://www.dotnetcurry.com/tutorials/devops">DevOps</a> <a href="https://www.dotnetcurry.com/tutorials/xamarin">Xamarin</a> <a href="https://www.dotnetcurry.com/tutorials/powershell">Powershell</a> <a href="https://www.dotnetcurry.com/tutorials/machine-learning-ai">Machine Learning & AI</a> <a href="https://www.dotnetcurry.com/tutorials/windows-store">UWP & Windows Store</a> <a href="https://www.dotnetcurry.com/tutorials/windowsphone" class="last">Windows Phone</a> <h5>Useful</h5> <a href="https://www.dotnetcurry.com/tutorials/dotnetinterview">.NET Interview Q&A</a> <a href="https://www.dotnetcurry.com/tutorials/product-articles-review">Product Reviews</a> <a href="https://www.dotnetcurry.com/tutorials/general-programming-topics">General Topics</a> </div> <div class="col-md-3"> <h5>JavaScript</h5> <a href="https://www.dotnetcurry.com/tutorials/jquery-aspnet">jQuery</a> <a href="https://www.dotnetcurry.com/tutorials/angularjs">Angular</a> <a href="https://www.dotnetcurry.com/tutorials/typescript">TypeScript</a> <a href="https://www.dotnetcurry.com/tutorials/nodejs">Node.js</a> <a href="https://www.dotnetcurry.com/tutorials/reactjs">React.js</a> <a href="https://www.dotnetcurry.com/tutorials/backbonejs">Backbone.js</a> <a href="https://www.dotnetcurry.com/tutorials/html5-javascript">HTML5 & JavaScript</a> <a href="https://www.dotnetcurry.com/tutorials/bootstrap-css">Bootstrap & CSS</a> </div> <div class="col-md-3"> <h5>Publications</h5> <a href="http://www.jquerycookbook.com/">Books</a> <a href="https://www.dotnetcurry.com/magazine/" class="last">Magazines</a> <h5>Older Technologies</h5> <a href="https://www.dotnetcurry.com/tutorials/silverlight">Silverlight</a> <a href="https://www.dotnetcurry.com/tutorials/expression-web">Expression Web</a> <a href="https://www.dotnetcurry.com/tutorials/expression-blend">Expression Blend</a> <a href="https://www.dotnetcurry.com/tutorials/windows-vista">Windows Vista</a> <a href="https://www.dotnetcurry.com/tutorials/microsoft-word">Word 2007</a> <a href="https://www.dotnetcurry.com/tutorials/microsoft-outlook">Outlook 2007</a> <a href="#"></a> </div> </div> </li> </ul> </li> <li class="dropdown megamenu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Featured <span class="fa fa-angle-down"></span></a> <ul class="dropdown-menu"> <li> <div class="row"> <div class="col-md-3 col-xs-12"> <div class="header-post"> <a href="https://www.dotnetcurry.com/angular/1385/angular-4-cheat-sheet"> <div class="hp-thumb"> <img data-src="/img/header/1385.jpg" class="img-responsive lazyload" alt="" /> </div> </a> <date>Aug 30, 2017</date> <h4><a href="https://www.dotnetcurry.com/angular/1385/angular-4-cheat-sheet">Angular 4 Development Cheat Sheet</a></h4> <p class="hidden-xs">A quick reference guide to get you going with Angular development. It uses Angular v4 with TypeScript.</p> </div> </div> <div class="col-md-3 col-xs-12"> <div class="header-post"> <a href="https://www.dotnetcurry.com/patterns-practices/1364/error-handling-dotnet-projects"> <div class="hp-thumb"> <!-- <div class="hp-overlay"> <img src="img/header/gallery.png" alt=""/> <span>12 Photos</span> </div> --> <img data-src="/img/header/1364.jpg" class="img-responsive lazyload" alt="" /> </div> </a> <date>May 12, 2017</date> <h4><a href="https://www.dotnetcurry.com/patterns-practices/1364/error-handling-dotnet-projects">Error Handling in Large .NET Projects - Best Practices</a></h4> <p class="hidden-xs">Learn some effective error handling strategies that you can use in your .NET projects.</p> </div> </div> <div class="col-md-3 col-xs-12"> <div class="header-post"> <a href="https://www.dotnetcurry.com/patterns-practices/1375/behavior-driven-development-bdd"> <div class="hp-thumb"> <img data-src="/img/header/1375.jpg" class="img-responsive lazyload" alt="" /> </div> </a> <date>July 3, 2017</date> <h4><a href="https://www.dotnetcurry.com/patterns-practices/1375/behavior-driven-development-bdd">Behavior Driven Development (BDD) – an in-depth look</a></h4> <p class="hidden-xs">Learn how Behavior Driven Development (BDD) works with a real-world example of how to use it.</p> </div> </div> <div class="col-md-3 col-xs-12"> <div class="header-post"> <a href="https://www.dotnetcurry.com/patterns-practices/1305/aspect-oriented-programming-aop-csharp-using-solid"> <div class="hp-thumb"> <img data-src="/img/header/1305.jpg" class="img-responsive lazyload" alt="" /> </div> </a> <date>Sep 25, 2016</date> <h4><a href="https://www.dotnetcurry.com/patterns-practices/1305/aspect-oriented-programming-aop-csharp-using-solid">Aspect Oriented Programming (AOP) in C# with SOLID</a></h4> <p class="hidden-xs">Aspect Oriented Programming (AOP) in C# using SOLID principles, with challenges and solutions.</p> </div> </div> <div class="col-md-3 col-xs-12"> <div class="header-post"> <a href="https://www.dotnetcurry.com/javascript/1359/javascript-frameworks-aspnet-mvc-developer"> <div class="hp-thumb"> <img data-src="/img/header/1359.jpg" class="img-responsive lazyload" alt="" /> </div> </a> <date>Sep 25, 2016</date> <h4><a href="https://www.dotnetcurry.com/javascript/1359/javascript-frameworks-aspnet-mvc-developer">JavaScript Frameworks for ASP.NET MVC Developers</a></h4> <p class="hidden-xs">Learn about a few JavaScript frameworks, and which one will be a good fit in your ASP.NET MVC apps</p> </div> </div> </div> </li> </ul> </li> <li class="dropdown megamenu"> <a href="https://www.dotnetcurry.com/magazine/">.NET Magazines</a> </li> <li class="dropdown dropdown-v1"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">About<span class="fa fa-angle-down"></span></a> <ul class="dropdown-menu"> <li><a href="https://www.dotnetcurry.com/About.aspx">About Us</a></li> <li><a href="https://www.dotnetcurry.com/WriteForUs.aspx">Write For Us</a></li> <li><a href="https://www.dotnetcurry.com/Contact.aspx">Contact Us</a></li> </ul> </li> <!--<li class="dropdown megamenu"> <a href="https://www.dotnetcurry.net/s/dnc-products">Developer Tools</a> </li>--> </ul> </div> <!-- /.navbar-collapse --> </div> </nav> </header> <!--header--> <!-- container --> <div class="container"> <div class="clearfix divborder"> <div class="col-md-8 column"> <div class="col-md-12 articlebox row"> <div class="articletitle"> <h1 class="articlehead"> <span id="ctl00_MainContent_lblTitle">Watermark and Add Copyright Info to your Images on your Local drive using C# and VB.NET</span> </h1> <b>Posted by: </b> <a id="ctl00_MainContent_lnkAddedBy" href="Author.aspx?AuthorName=Suprotim Agarwal">Suprotim Agarwal</a> , on 12/14/2008, in <b> Category </b> <a id="ctl00_MainContent_lnkCategory" href="BrowseArticles.aspx?CatID=47">WinForms & WinRT</a> <br /> </div> <div class="articlestats"> <div class="stats1"> <b>Views: </b> 86356 <br/> </div> </div> <div class="articleabstract"> <b>Abstract: </b> Most of us, who run websites/blogs or host technical content, face issues of our images being copied and displayed on other blogs. One of the solutions to this problem is watermarking our images with our logo or watermarking the website name on the images.In this article, I will propose a desktop solution using Windows Forms, which can be used to watermark images before you upload the images to the site. </div> <div class="socialshare"> <a class="resp-sharing-button__link" id="fbsharelinktop" target="_blank" aria-label=""> <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> <g> <path d="M18.768,7.465H14.5V5.56c0-0.896,0.594-1.105,1.012-1.105s2.988,0,2.988,0V0.513L14.171,0.5C10.244,0.5,9.5,3.438,9.5,5.32 v2.145h-3v4h3c0,5.212,0,12,0,12h5c0,0,0-6.85,0-12h3.851L18.768,7.465z"/> </g> </svg> <span></span> </div> </div> </a> <a class="resp-sharing-button__link" id="twtsharelinktop" target="_blank" aria-label=""> <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> <g> <path d="M23.444,4.834c-0.814,0.363-1.5,0.375-2.228,0.016c0.938-0.562,0.981-0.957,1.32-2.019c-0.878,0.521-1.851,0.9-2.886,1.104 C18.823,3.053,17.642,2.5,16.335,2.5c-2.51,0-4.544,2.036-4.544,4.544c0,0.356,0.04,0.703,0.117,1.036 C8.132,7.891,4.783,6.082,2.542,3.332C2.151,4.003,1.927,4.784,1.927,5.617c0,1.577,0.803,2.967,2.021,3.782 C3.203,9.375,2.503,9.171,1.891,8.831C1.89,8.85,1.89,8.868,1.89,8.888c0,2.202,1.566,4.038,3.646,4.456 c-0.666,0.181-1.368,0.209-2.053,0.079c0.579,1.804,2.257,3.118,4.245,3.155C5.783,18.102,3.372,18.737,1,18.459 C3.012,19.748,5.399,20.5,7.966,20.5c8.358,0,12.928-6.924,12.928-12.929c0-0.198-0.003-0.393-0.012-0.588 C21.769,6.343,22.835,5.746,23.444,4.834z"/> </g> </svg> <span></span> </div> </div> </a> <a class="resp-sharing-button__link" id="linkdinsharelinktop" target="_blank" aria-label=""> <div class="resp-sharing-button resp-sharing-button--linkedin resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z"/></svg> <span></span> </div> </div> </a> <!--<a class="resp-sharing-button__link" id="googsharelinktop" target="_blank" aria-label=""> <div class="resp-sharing-button resp-sharing-button--google resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> <g> <path d="M11.366,12.928c-0.729-0.516-1.393-1.273-1.404-1.505c0-0.425,0.038-0.627,0.988-1.368 c1.229-0.962,1.906-2.228,1.906-3.564c0-1.212-0.37-2.289-1.001-3.044h0.488c0.102,0,0.2-0.033,0.282-0.091l1.364-0.989 c0.169-0.121,0.24-0.338,0.176-0.536C14.102,1.635,13.918,1.5,13.709,1.5H7.608c-0.667,0-1.345,0.118-2.011,0.347 c-2.225,0.766-3.778,2.66-3.778,4.605c0,2.755,2.134,4.845,4.987,4.91c-0.056,0.22-0.084,0.434-0.084,0.645 c0,0.425,0.108,0.827,0.33,1.216c-0.026,0-0.051,0-0.079,0c-2.72,0-5.175,1.334-6.107,3.32C0.623,17.06,0.5,17.582,0.5,18.098 c0,0.501,0.129,0.984,0.382,1.438c0.585,1.046,1.843,1.861,3.544,2.289c0.877,0.223,1.82,0.335,2.8,0.335 c0.88,0,1.718-0.114,2.494-0.338c2.419-0.702,3.981-2.482,3.981-4.538C13.701,15.312,13.068,14.132,11.366,12.928z M3.66,17.443 c0-1.435,1.823-2.693,3.899-2.693h0.057c0.451,0.005,0.892,0.072,1.309,0.2c0.142,0.098,0.28,0.192,0.412,0.282 c0.962,0.656,1.597,1.088,1.774,1.783c0.041,0.175,0.063,0.35,0.063,0.519c0,1.787-1.333,2.693-3.961,2.693 C5.221,20.225,3.66,19.002,3.66,17.443z M5.551,3.89c0.324-0.371,0.75-0.566,1.227-0.566l0.055,0 c1.349,0.041,2.639,1.543,2.876,3.349c0.133,1.013-0.092,1.964-0.601,2.544C8.782,9.589,8.363,9.783,7.866,9.783H7.865H7.844 c-1.321-0.04-2.639-1.6-2.875-3.405C4.836,5.37,5.049,4.462,5.551,3.89z"/> <polygon points="23.5,9.5 20.5,9.5 20.5,6.5 18.5,6.5 18.5,9.5 15.5,9.5 15.5,11.5 18.5,11.5 18.5,14.5 20.5,14.5 20.5,11.5 23.5,11.5 "/> </g> </svg> </div> </div> </a>--> </div> </div> <div id="articleBody" class="col-md-12 row"> <div style="MARGIN: 24pt 0in 0pt" align="justify"><b><font size="6"><font face="Cambria" color="#365f91" size="5">Watermark and Add Copyright Info to your Images on your Local drive using C# and VB.NET</font></font></b></div> <div style="MARGIN: 0in 0in 10pt" align="justify"> </div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">Prevention is better than cure! Most of us, who run websites/blogs or host technical content, face issues of our images being copied and displayed on other blogs. There are a couple of techniques we can adopt to safeguard our copyrighted content and prevent people from doing so. One of them is watermarking our images with our logo or watermarking the website name on the images. A few weeks ago, I had discussed one such technique using ASP.NET. In this article, I will propose a desktop solution using Windows Forms, which can be used to watermark images before you upload the images to the site. This desktop solution basically saves us some processing and response time while watermarking images. Let us get started.</font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">Create a Windows application. Drop a Button control (btnWatermark), a label(lblStatus) and a FolderBrowserDialog component from the ToolBox to the Form.</font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">In the button click, open a dialog box using the FolderBrowerDialog component, which enables the user to select a folder containing images. We then loop through all images in that folder, create a filestream object and then pass it to the AddWatermark(). The AddWatermark method has been taken from a code sample posted by Rong-Chun over </font><a href="http://social.msdn.microsoft.com/forums/en-US/winforms/thread/71eafce1-dd2e-4a55-abe8-a93fe4d37942/"><font face="Verdana" size="2">here</font></a></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">The AddWatermark accepts a FileStream and then draws the watermark on the image using the Graphics class. Here’s the code to do draw watermark on your images.</font></div> <div style="MARGIN: 0in 0in 10pt"><font face="Verdana" size="2">C#</font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">using</span><span style="FONT-FAMILY: 'Courier New'"> System;</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">using</span><span style="FONT-FAMILY: 'Courier New'"> System.Collections.Generic;</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">using</span><span style="FONT-FAMILY: 'Courier New'"> System.Drawing;</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">using</span><span style="FONT-FAMILY: 'Courier New'"> System.Windows.Forms;</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">using</span><span style="FONT-FAMILY: 'Courier New'"> System.IO;</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">using</span><span style="FONT-FAMILY: 'Courier New'"> System.Drawing.Imaging;</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">namespace</span><span style="FONT-FAMILY: 'Courier New'"> WatermarkImages</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2">{</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">public</span> <span style="COLOR: blue">partial</span> <span style="COLOR: blue">class</span> <span style="COLOR: #2b91af">Form1</span> : <span style="COLOR: #2b91af">Form</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">public</span> Form1()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> InitializeComponent();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">this</span>.folderBrowserDialog1.Description =</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #a31515">"Select the images directory"</span>;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">// Disallow creation of new files using the FolderBrowserDialog.</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">this</span>.folderBrowserDialog1.ShowNewFolderButton = <span style="COLOR: blue">false</span>;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">private</span> <span style="COLOR: blue">void</span> btnWatermark_Click(<span style="COLOR: blue">object</span> sender, <span style="COLOR: #2b91af">EventArgs</span> e)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">string</span> path = <span style="COLOR: #2b91af">String</span>.Empty;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">DialogResult</span> result = folderBrowserDialog1.ShowDialog();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">if</span> (result == <span style="COLOR: #2b91af">DialogResult</span>.OK)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> path = folderBrowserDialog1.SelectedPath;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">if</span> (path == <span style="COLOR: #2b91af">String</span>.Empty)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = <span style="COLOR: #a31515">"Invalid directory.."</span>;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">return</span>;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = <span style="COLOR: #2b91af">String</span>.Empty; </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Image</span> img = <span style="COLOR: blue">null</span>;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">string</span> fullPath = <span style="COLOR: #2b91af">String</span>.Empty;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">try</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">string</span>[] imgExtension = { <span style="COLOR: #a31515">"*.jpg"</span>, <span style="COLOR: #a31515">"*.jpeg"</span>, <span style="COLOR: #a31515">".gif"</span>, <span style="COLOR: #a31515">"*.bmp"</span> };</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">List</span><<span style="COLOR: #2b91af">FileInfo</span>> files = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">List</span><<span style="COLOR: #2b91af">FileInfo</span>>(); </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">DirectoryInfo</span> dir = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">DirectoryInfo</span>(path);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">foreach</span> (<span style="COLOR: blue">string</span> ext <span style="COLOR: blue">in</span> imgExtension)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">FileInfo</span>[] folder = dir.GetFiles(ext, <span style="COLOR: #2b91af">SearchOption</span>.AllDirectories);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">foreach</span> (<span style="COLOR: #2b91af">FileInfo</span> file <span style="COLOR: blue">in</span> folder)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">FileStream</span> fs = file.OpenRead();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> fullPath = path + <span style="COLOR: #a31515">@"\"</span> + file.Name ;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Stream</span> outputStream = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">MemoryStream</span>();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> AddWatermark(fs, <span style="COLOR: #a31515">"www.dotnetcurry.com"</span>, outputStream);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> fs.Close();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> file.Delete();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img = <span style="COLOR: #2b91af">Image</span>.FromStream(outputStream);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">using</span> (<span style="COLOR: #2b91af">Bitmap</span> savingImage = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Bitmap</span>(img.Width, img.Height, img.PixelFormat))</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">using</span> (<span style="COLOR: #2b91af">Graphics</span> g = <span style="COLOR: #2b91af">Graphics</span>.FromImage(savingImage))</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> g.DrawImage(img, <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Point</span>(0, 0));</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> savingImage.Save(fullPath, <span style="COLOR: #2b91af">ImageFormat</span>.Jpeg); </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img.Dispose();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = <span style="COLOR: #a31515">"Processing Completed"</span>;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">catch</span> (<span style="COLOR: #2b91af">Exception</span> ex)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = <span style="COLOR: #a31515">"There was an error during processing.."</span>; </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">finally</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">if</span> (img != <span style="COLOR: blue">null</span>)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img.Dispose();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">public</span> <span style="COLOR: blue">void</span> AddWatermark(<span style="COLOR: #2b91af">FileStream</span> fs, <span style="COLOR: blue">string</span> watermarkText, <span style="COLOR: #2b91af">Stream</span> outputStream)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Image</span> img = <span style="COLOR: #2b91af">Image</span>.FromStream(fs); </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Font</span> font = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Font</span>(<span style="COLOR: #a31515">"Verdana"</span>, 16, <span style="COLOR: #2b91af">FontStyle</span>.Bold, <span style="COLOR: #2b91af">GraphicsUnit</span>.Pixel);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">//Adds a transparent watermark with an 100 alpha value.</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Color</span> color = <span style="COLOR: #2b91af">Color</span>.FromArgb(100, 0, 0, 0);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">//The position where to draw the watermark on the image</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Point</span> pt = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Point</span>(10, 30); </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">SolidBrush</span> sbrush = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">SolidBrush</span>(color);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Graphics</span> gr = <span style="COLOR: blue">null</span>;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">try</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr = <span style="COLOR: #2b91af">Graphics</span>.FromImage(img);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">catch</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> {</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">// http://support.microsoft.com/Default.aspx?id=814675</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: #2b91af">Image</span> img1 = img;</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img = <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Bitmap</span>(img.Width, img.Height);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr = <span style="COLOR: #2b91af">Graphics</span>.FromImage(img);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr.DrawImage(img1, <span style="COLOR: blue">new</span> <span style="COLOR: #2b91af">Rectangle</span>(0, 0, img.Width, img.Height), 0, 0, img.Width, img.Height, <span style="COLOR: #2b91af">GraphicsUnit</span>.Pixel);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img1.Dispose();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr.DrawString(watermarkText, font, sbrush, pt);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr.Dispose();</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img.Save(outputStream, <span style="COLOR: #2b91af">ImageFormat</span>.Jpeg);</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> </font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2">}</font></span></div> <div style="MARGIN: 0in 0in 10pt"> </div> <div style="MARGIN: 0in 0in 10pt"><font face="Verdana" size="2">VB.NET</font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Imports</span><span style="FONT-FAMILY: 'Courier New'"> System</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Imports</span><span style="FONT-FAMILY: 'Courier New'"> System.Collections.Generic</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Imports</span><span style="FONT-FAMILY: 'Courier New'"> System.Drawing</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Imports</span><span style="FONT-FAMILY: 'Courier New'"> System.Windows.Forms</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Imports</span><span style="FONT-FAMILY: 'Courier New'"> System.IO</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Imports</span><span style="FONT-FAMILY: 'Courier New'"> System.Drawing.Imaging</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">Namespace</span><span style="FONT-FAMILY: 'Courier New'"> WatermarkImages</span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Partial</span> <span style="COLOR: blue">Public</span> <span style="COLOR: blue">Class</span> Form1</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Inherits</span> Form</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Public</span> <span style="COLOR: blue">Sub</span> <span style="COLOR: blue">New</span>()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> InitializeComponent()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Me</span>.folderBrowserDialog1.Description = "Select the images directory"</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">' Disallow creation of new files using the FolderBrowserDialog.</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Me</span>.folderBrowserDialog1.ShowNewFolderButton = <span style="COLOR: blue">False</span></font></span></div> <div style="MARGIN: 0in 0in 10pt"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">Sub</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Private</span> <span style="COLOR: blue">Sub</span> btnWatermark_Click(<span style="COLOR: blue">ByVal</span> sender <span style="COLOR: blue">As</span> <span style="COLOR: blue">Object</span>, <span style="COLOR: blue">ByVal</span> e <span style="COLOR: blue">As</span> EventArgs)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> path <span style="COLOR: blue">As</span> <span style="COLOR: blue">String</span> = <span style="COLOR: blue">String</span>.Empty</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> result <span style="COLOR: blue">As</span> DialogResult = folderBrowserDialog1.ShowDialog()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">If</span> result = DialogResult.OK <span style="COLOR: blue">Then</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> path = folderBrowserDialog1.SelectedPath</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">If</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">If</span> path = <span style="COLOR: blue">String</span>.Empty <span style="COLOR: blue">Then</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = "Invalid directory.."</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Return</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">If</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = <span style="COLOR: blue">String</span>.Empty</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> img <span style="COLOR: blue">As</span> Image = <span style="COLOR: blue">Nothing</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> fullPath <span style="COLOR: blue">As</span> <span style="COLOR: blue">String</span> = <span style="COLOR: blue">String</span>.Empty</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Try</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> imgExtension() <span style="COLOR: blue">As</span> <span style="COLOR: blue">String</span> = { "*.jpg", "*.jpeg", ".gif", "*.bmp" }</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> files <span style="COLOR: blue">As</span> List(<span style="COLOR: blue">Of</span> FileInfo) = <span style="COLOR: blue">New</span> List(<span style="COLOR: blue">Of</span> FileInfo)()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> dir <span style="COLOR: blue">As</span> <span style="COLOR: blue">New</span> DirectoryInfo(path)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">For</span> <span style="COLOR: blue">Each</span> ext <span style="COLOR: blue">As</span> <span style="COLOR: blue">String</span> <span style="COLOR: blue">In</span> imgExtension</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> folder() <span style="COLOR: blue">As</span> FileInfo = dir.GetFiles(ext, SearchOption.AllDirectories)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">For</span> <span style="COLOR: blue">Each</span> file <span style="COLOR: blue">As</span> FileInfo <span style="COLOR: blue">In</span> folder</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> fs <span style="COLOR: blue">As</span> FileStream = file.OpenRead()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> fullPath = path & "\" & file.Name</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> outputStream <span style="COLOR: blue">As</span> Stream = <span style="COLOR: blue">New</span> MemoryStream()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> AddWatermark(fs, "www.dotnetcurry.com", outputStream)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> fs.Close()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> file.Delete()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img = Image.FromStream(outputStream)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Using</span> savingImage <span style="COLOR: blue">As</span> <span style="COLOR: blue">New</span> Bitmap(img.Width, img.Height, img.PixelFormat)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Using</span> g <span style="COLOR: blue">As</span> Graphics = Graphics.FromImage(savingImage)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> g.DrawImage(img, <span style="COLOR: blue">New</span> Point(0, 0))</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">Using</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> savingImage.Save(fullPath, ImageFormat.Jpeg)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">Using</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img.Dispose()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Next</span> file</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Next</span> ext</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = "Processing Completed"</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Catch</span> ex <span style="COLOR: blue">As</span> Exception</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> lblStatus.Text = "There was an error during processing.."</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Finally</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">If</span> img <span style="COLOR: blue">IsNot</span> <span style="COLOR: blue">Nothing</span> <span style="COLOR: blue">Then</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img.Dispose()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">If</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">Try</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">Sub</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Public</span> <span style="COLOR: blue">Sub</span> AddWatermark(<span style="COLOR: blue">ByVal</span> fs <span style="COLOR: blue">As</span> FileStream, <span style="COLOR: blue">ByVal</span> watermarkText <span style="COLOR: blue">As</span> <span style="COLOR: blue">String</span>, <span style="COLOR: blue">ByVal</span> outputStream <span style="COLOR: blue">As</span> Stream)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> img <span style="COLOR: blue">As</span> Image = Image.FromStream(fs)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> font <span style="COLOR: blue">As</span> <span style="COLOR: blue">New</span> Font("Verdana", 16, FontStyle.Bold, GraphicsUnit.Pixel)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">'Adds a transparent watermark with an 100 alpha value.</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> color <span style="COLOR: blue">As</span> Color = Color.FromArgb(100, 0, 0, 0)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">'The position where to draw the watermark on the image</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> pt <span style="COLOR: blue">As</span> <span style="COLOR: blue">New</span> Point(10, 30)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> sbrush <span style="COLOR: blue">As</span> <span style="COLOR: blue">New</span> SolidBrush(color)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> gr <span style="COLOR: blue">As</span> Graphics = <span style="COLOR: blue">Nothing</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Try</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr = Graphics.FromImage(img)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Catch</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: green">' http://support.microsoft.com/Default.aspx?id=814675</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">Dim</span> img1 <span style="COLOR: blue">As</span> Image = img</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img = <span style="COLOR: blue">New</span> Bitmap(img.Width, img.Height)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr = Graphics.FromImage(img)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr.DrawImage(img1, <span style="COLOR: blue">New</span> Rectangle(0, 0, img.Width, img.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img1.Dispose()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">Try</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr.DrawString(watermarkText, font, sbrush, pt)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> gr.Dispose()</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> img.Save(outputStream, ImageFormat.Jpeg)</font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><span style="FONT-FAMILY: 'Courier New'"><font size="2"> <span style="COLOR: blue">End</span> <span style="COLOR: blue">Sub</span></font></span></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">End</span><span style="FONT-FAMILY: 'Courier New'"> <span style="COLOR: blue">Class</span></span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"><font size="2"><span style="COLOR: blue; FONT-FAMILY: 'Courier New'">End</span><span style="FONT-FAMILY: 'Courier New'"> <span style="COLOR: blue">Namespace</span></span></font></div> <div style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"> </div> <div style="MARGIN: 0in 0in 10pt"> </div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">I have added a few .gif, .jpg and .bmp images at C:\MyImageFolder. Run the application. Click the button to open the FolderBrowserDialog and select the image folder of your choice as shown below.</font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2"><img alt="FolderBrowser" src="https://www.dotnetcurry.com/images/WinForms/folderBrowse.jpg" /></font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">When you click OK, the images are processed and watermark is added to the images. </font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2"><img alt="Processing" src="https://www.dotnetcurry.com/images/WinForms/Processing.jpg" /></font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">In the example, I have added the text “www.dotnetcurry.com” to the image as shown below.</font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2"><img alt="Watermark" src="https://www.dotnetcurry.com/images/WinForms/Watermark.jpg" /></font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2">I am sure this solution would help out website owners to protect their copyrighted images. I hope this article was useful and I thank you for viewing it. </font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2"> <span style="LINE-HEIGHT: 115%"><span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana', 'sans-serif'">If you liked the article, <a href="http://feeds.feedburner.com/netCurryRecentArticles" type="application/rss+xml" rel="alternate"><img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VERTICAL-ALIGN: middle; BORDER-RIGHT-WIDTH: 0px" alt="" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" /></a> <a href="http://feeds.feedburner.com/netCurryRecentArticles" type="application/rss+xml" rel="alternate">Subscribe to my RSS Feed</a> or <a href="http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1571277&loc=en_US">Subscribe Via Email</a></span></span></font></div> <div style="MARGIN: 0in 0in 10pt" align="justify"><font face="Verdana" size="2"><span style="LINE-HEIGHT: 115%"><span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana', 'sans-serif'"></span></span></font></div> <p><em>This article has been editorially reviewed by </em><a href="https://www.dotnetcurry.com/author/suprotim-agarwal"><em>Suprotim Agarwal.</em></a></p> <div id="csharpbook" class="col-xs-12 col-sm-12 col-md-12 col-lg-12 articletext"> <!--<a href="http://www.dotnetcurry.org/r/dnc-csharpbk-web-imgbtm" target="_blank" style="color:#cd282f"><img alt="Absolutely Awesome Book on C# and .NET" src="/csharpbook/images/csharpbook-hori.jpg" /></a>--> <div class="col-md-3 col-sm-3 col-xs-12"> <a href="https://www.dotnetcurry.com/csharpbook" target="_blank"><img alt="Absolutely Awesome Book on C# and .NET" src="/csharpbook/images/csharp-book-ad.jpg" /></a> </div> <div class="col-md-9 col-sm-9 col-xs-12"> <p>C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.</p> <p>We at DotNetCurry are very excited to announce <strong><a href="https://www.dotnetcurry.com/csharpbook" target="_blank">The Absolutely Awesome Book on C# and .NET</a></strong>. This is a 500 pages concise technical eBook available in PDF, ePub (iPad), and Mobi (Kindle). </p><p>Organized around concepts, this Book aims to provide a concise, yet solid foundation in C# and .NET, covering <b>C# 6.0, C# 7.0 and .NET Core, with chapters on the latest .NET Core 3.0, .NET Standard and C# 8.0 (final release) too</b>. Use these concepts to deepen your existing knowledge of C# and .NET, to have a solid grasp of the latest in C# and .NET OR to crack your next .NET Interview.</p> <p><strong><a href="https://www.dotnetcurry.com/csharpbook" target="_blank" style="color:#cd282f">Click here to Explore the Table of Contents or Download Sample Chapters!<a /></strong></p> </div> </div> <div class="footerheading margin-top-20">What Others Are Reading!</div> <div class="col-xs-12 col-sm-12 col-md-12 similarauthor"> <div class="row"> <div class="col-md-12 similararticles"> <a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=462" style="color:#4A75AD;font-weight:normal;">Creating a Weather Gadget for Windows 7</a> <br /><br /> <a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=431" style="color:#4A75AD;font-weight:normal;">Programmatically Increase, Decrease and Mute the Volume</a> <br /><br /> <a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=419" style="color:#4A75AD;font-weight:normal;">Using .NET to Post a New BlogPost in Wordpress</a> <br /><br /> <a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=357" style="color:#4A75AD;font-weight:normal;">BING Desktop Translator using C# and VB.NET</a> <br /><br /> <a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=346" style="color:#4A75AD;font-weight:normal;">Google Talk (GTalk) Autoreply using .NET</a> <br /><br /> <a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=323" style="color:#4A75AD;font-weight:normal;">Bulk Insert into SQL Server using SqlBulkCopy</a> <br /><br /> <span id="ctl00_MainContent_SimilarPosts1_lblCategoNam"></span> </div> </div> </div> <!-- DNC_BottomText --> <div class="visible-xs visible-sm visible-md visible-lg"> <div id='dnc-bot-txtad' class="articletext"> </div> </div> <div class="socialbox"> <b>Was this article worth reading? Share it with fellow developers too. Thanks!</b> <br/> <!-- Sharingbutton Facebook --> <a class="resp-sharing-button__link" id="fbsharelink" target="_blank" aria-label="Share on Facebook"> <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--large"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> <g> <path d="M18.768,7.465H14.5V5.56c0-0.896,0.594-1.105,1.012-1.105s2.988,0,2.988,0V0.513L14.171,0.5C10.244,0.5,9.5,3.438,9.5,5.32 v2.145h-3v4h3c0,5.212,0,12,0,12h5c0,0,0-6.85,0-12h3.851L18.768,7.465z"/> </g> </svg> </div>Share on Facebook</div> </a> <!-- Sharingbutton Twitter --> <a class="resp-sharing-button__link" id="twtsharelink" target="_blank" aria-label="Share on Twitter"> <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--large"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> <g> <path d="M23.444,4.834c-0.814,0.363-1.5,0.375-2.228,0.016c0.938-0.562,0.981-0.957,1.32-2.019c-0.878,0.521-1.851,0.9-2.886,1.104 C18.823,3.053,17.642,2.5,16.335,2.5c-2.51,0-4.544,2.036-4.544,4.544c0,0.356,0.04,0.703,0.117,1.036 C8.132,7.891,4.783,6.082,2.542,3.332C2.151,4.003,1.927,4.784,1.927,5.617c0,1.577,0.803,2.967,2.021,3.782 C3.203,9.375,2.503,9.171,1.891,8.831C1.89,8.85,1.89,8.868,1.89,8.888c0,2.202,1.566,4.038,3.646,4.456 c-0.666,0.181-1.368,0.209-2.053,0.079c0.579,1.804,2.257,3.118,4.245,3.155C5.783,18.102,3.372,18.737,1,18.459 C3.012,19.748,5.399,20.5,7.966,20.5c8.358,0,12.928-6.924,12.928-12.929c0-0.198-0.003-0.393-0.012-0.588 C21.769,6.343,22.835,5.746,23.444,4.834z"/> </g> </svg> </div>Share on Twitter</div> </a> <!-- Sharingbutton LinkedIn --> <a class="resp-sharing-button__link" id="linkdinsharelink" target="_blank" aria-label="Share on LinkedIn"> <div class="resp-sharing-button resp-sharing-button--linkedin resp-sharing-button--large"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z"/></svg> </div>Share on LinkedIn</div> </a> <!-- Sharingbutton Google+ --> <a class="resp-sharing-button__link" id="googsharelink" target="_blank" aria-label="Share on Google+"> <div class="resp-sharing-button resp-sharing-button--google resp-sharing-button--large"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"> <g> <path d="M11.366,12.928c-0.729-0.516-1.393-1.273-1.404-1.505c0-0.425,0.038-0.627,0.988-1.368 c1.229-0.962,1.906-2.228,1.906-3.564c0-1.212-0.37-2.289-1.001-3.044h0.488c0.102,0,0.2-0.033,0.282-0.091l1.364-0.989 c0.169-0.121,0.24-0.338,0.176-0.536C14.102,1.635,13.918,1.5,13.709,1.5H7.608c-0.667,0-1.345,0.118-2.011,0.347 c-2.225,0.766-3.778,2.66-3.778,4.605c0,2.755,2.134,4.845,4.987,4.91c-0.056,0.22-0.084,0.434-0.084,0.645 c0,0.425,0.108,0.827,0.33,1.216c-0.026,0-0.051,0-0.079,0c-2.72,0-5.175,1.334-6.107,3.32C0.623,17.06,0.5,17.582,0.5,18.098 c0,0.501,0.129,0.984,0.382,1.438c0.585,1.046,1.843,1.861,3.544,2.289c0.877,0.223,1.82,0.335,2.8,0.335 c0.88,0,1.718-0.114,2.494-0.338c2.419-0.702,3.981-2.482,3.981-4.538C13.701,15.312,13.068,14.132,11.366,12.928z M3.66,17.443 c0-1.435,1.823-2.693,3.899-2.693h0.057c0.451,0.005,0.892,0.072,1.309,0.2c0.142,0.098,0.28,0.192,0.412,0.282 c0.962,0.656,1.597,1.088,1.774,1.783c0.041,0.175,0.063,0.35,0.063,0.519c0,1.787-1.333,2.693-3.961,2.693 C5.221,20.225,3.66,19.002,3.66,17.443z M5.551,3.89c0.324-0.371,0.75-0.566,1.227-0.566l0.055,0 c1.349,0.041,2.639,1.543,2.876,3.349c0.133,1.013-0.092,1.964-0.601,2.544C8.782,9.589,8.363,9.783,7.866,9.783H7.865H7.844 c-1.321-0.04-2.639-1.6-2.875-3.405C4.836,5.37,5.049,4.462,5.551,3.89z"/> <polygon points="23.5,9.5 20.5,9.5 20.5,6.5 18.5,6.5 18.5,9.5 15.5,9.5 15.5,11.5 18.5,11.5 18.5,14.5 20.5,14.5 20.5,11.5 23.5,11.5 "/> </g> </svg> </div>Share on Google+</div> </a> <!--<ul class="socialshare"> <li><div class="gplusarticle"><b>Please Share this article if you think it was worth reading. Thanks!</b></div></li> <li><div class="fb-share-button" data-layout="button"> </div> </li> <li><script type="IN/Share"></script></li> </ul>--> </div> <br /> <div class="col-xs-12 col-sm-12 col-md-12 similarauthor"> <div class="row footerheading">Author</div> <div class="row"> <div class="col-md-12"> <div class="col-md-12 author-wrap img-rounded"> <div class="author-image thumbnail"> <img id="ctl00_MainContent_authorInfo_imgAuthor" onerror="this.onload = null; this.src='/images/authors/NoImage.jpg';" src="images/authors/Suprotim%20Agarwal.jpg" style="border-width:0px;" /> </div> <div class="author-desc caption"> Suprotim Agarwal, MCSD, MCAD, MCDBA, MCSE, is the founder of <a href='http://www.dotnetcurry.com'>DotNetCurry</a>, <a href='http://www.dotnetcurry.com/magazine'>DNC Magazine for Developers</a>, <a href='http://www.sqlservercurry.com' target='_blank'>SQLServerCurry</a> and <a href='http://www.devcurry.com' target='_blank'>DevCurry</a>. He has also authored a couple of books <a href='http://www.dotnetcurry.com/order/jQueryASPNETRecipesBook.aspx'>51 Recipes using jQuery with ASP.NET Controls</a> and <a href='http://www.jquerycookbook.com' target='_blank'>The Absolutely Awesome jQuery CookBook</a>.<p></p><p>Suprotim has received the prestigious <a href='https://mvp.microsoft.com/en-US/Overview'>Microsoft MVP award</a> for Sixteen consecutive years. In a professional capacity, he is the CEO of A2Z Knowledge Visuals Pvt Ltd, a digital group that offers Digital Marketing and Branding services to businesses, both in a start-up and enterprise environment.</p><p>Get in touch with him on Twitter @<a href='http://twitter.com/suprotimagarwal' target='_blank'>suprotimagarwal</a> or at <a href='https://www.linkedin.com/in/suprotimagarwal'>LinkedIn</a></p> </div> </div> </div> </div> </div> </div> <!--<div class="footerheading">Further Reading - Articles You May Like!</div>--> <div class="marginspace"> <div id='ban-pos-9-90'></div> <div id='ban-pos-10-90'></div> <div id='ban-pos-11-90'></div> </div> <br /><br /> <div class="col-xs-12 col-sm-12 col-md-12"> <!--<a href="http://www.copyscape.com/" target="blank" rel="nofollow">--><img src="/images/copyscape.gif" alt="Page copy protected against web site content infringement by Copyscape" title="Do not copy content from the page. Plagiarism will be detected by Copyscape." height="16" border="0"/><!--</a>--> </div> <br /><br /> <br /> <hr /> <div id="ctl00_MainContent_panComments" class="col-md-12 spacer"> <div class="footerheading">Feedback - Leave us some adulation, criticism and everything in between!</div> <ul class="tabHeader"> <li><a class="show-comments" href="#t1">Click here to post your Comments</a> </li> <li><a href="#t2">Old Comments (Read Only)</a> </li> </ul> <div class="tabContent"> <div id="t1" class="col-md-12 column"> <div id="disqus_thread"></div> <!--<script type="text/javascript"> var disqus_shortname = 'dotnetcurry'; /* * * DON'T EDIT BELOW THIS LINE * * */ (function () { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>--> </div> <div id="t2"> <table id="ctl00_MainContent_dlstComments" class="table col-xs-4 col-sm-6 col-md-12" cellspacing="0" border="0" style="color:#333333;border-collapse:collapse;"> <tr> <td style="color:#333333;background-color:#EFEFE3;"> <div> <table class="table"> <tr><td class="row"> <b>Comment posted by <span id="ctl00_MainContent_dlstComments_ctl00_lnkAddedBy" style="color:#6592C6;">Vivek</span> on Sunday, December 14, 2008 3:42 PM </b> </td> <td style="text-align: right;"> </td></tr> </table> Good Work!!! <br>I like this article. <br> <br>Vivek <br>http://dotnetguts.blogspot.com <br> <br> </div> </td> </tr><tr> <td style="color:#333333;background-color:White;"> <div> <table class="table"> <tr><td class="row"> <b>Comment posted by <span id="ctl00_MainContent_dlstComments_ctl01_lnkAddedBy" style="color:#6592C6;">Ramesh Bandi</span> on Wednesday, October 28, 2009 10:01 AM </b> </td> <td style="text-align: right;"> </td></tr> </table> Saved a lot of time. Thanks! <br> <br>Ramesh Bandi </div> </td> </tr><tr> <td style="color:#333333;background-color:#EFEFE3;"> <div> <table class="table"> <tr><td class="row"> <b>Comment posted by <span id="ctl00_MainContent_dlstComments_ctl02_lnkAddedBy" style="color:#6592C6;">sagar</span> on Thursday, April 17, 2014 8:02 AM </b> </td> <td style="text-align: right;"> </td></tr> </table> really nice article sir <br> <br>but if u possible in web base application ? <br> </div> </td> </tr><tr> <td style="color:#333333;background-color:White;"> <div> <table class="table"> <tr><td class="row"> <b>Comment posted by <span id="ctl00_MainContent_dlstComments_ctl03_lnkAddedBy" style="color:#6592C6;">Hardik</span> on Saturday, April 11, 2015 2:44 PM </b> </td> <td style="text-align: right;"> </td></tr> </table> Can we do reverse the process ? Means remove watermark from images using .net ?? </div> </td> </tr><tr> <td style="color:White;background-color:#990000;font-weight:bold;"> </td> </tr> </table> </div> <!-- t2 --> </div> <!-- tabcontent --> </div> <!-- Place this render call where appropriate <script type="text/javascript"> (function () { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> <script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script> <script> !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } } (document, "script", "twitter-wjs");</script>--> <!-- Finally, to actually run the highlighter, you need to include this JS on your page --> </div> <div id="rightcol" class="col-md-4"> <!-- <div class="row"> <div class="spacerforsearch"> <div class="input-group"> <input name="ctl00$searchbox" id="ctl00_searchbox" type="text" class="form-control" placeholder="Search DotNetCurry.com for..." onFocus="this.className = 'form-control'" style="border-color:#94C7EF;border-width:1px;border-style:solid;width:100%" /> <span class="input-group-btn"> <input type="submit" name="ctl00$SearchButton" value="Go!" id="ctl00_SearchButton" class="btn btn-default" type="button" /> </span> </div> </div> </div> --> <div class="margin-vertical-20" /> <div class="side-widget"> <div class="featured-tools"> <span>Featured Tools</span> <div id="creatives"> <div id='ban-pos-1' style='display: none'> </div> <div id='ban-pos-2'> <div class="padding-vertical-10"></div> </div> <div id='ban-pos-3'> </div> <div class="padding-vertical-10"></div> <div id='ban-pos-4-250'> </div> <div id='ban-pos-5-250'> </div> <div id='ban-pos-6-250'> </div> </div> </div> </div> <div class="sec-title"> <h4>Categories</h4> </div> <div class="side-widget"> <ul id="toggle-view"> <li> <h3>.NET Web</h3> <span class="fa fa-angle-down"></span> <div class="toggle-panel"> <div> <a href="https://www.dotnetcurry.com/tutorials/aspnet">ASP.NET</a> <a href="https://www.dotnetcurry.com/tutorials/aspnet-mvc">ASP.NET MVC</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/aspnet-core">ASP.NET Core</a> <a href="https://www.dotnetcurry.com/tutorials/aspnet-ajax">ASP.NET AJAX</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/sharepoint">SharePoint</a> <a href="https://www.dotnetcurry.com/tutorials/wcf">WCF</a> </div> </div> </li> <li> <h3>.NET Framework, Visual Studio and C#</h3> <span class="fa fa-angle-down"></span> <div class="toggle-panel"> <div> <a href="https://www.dotnetcurry.com/tutorials/csharp">C#</a> <a href="https://www.dotnetcurry.com/tutorials/linq">LINQ</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/visualstudio">Visual Studio</a> <a href="https://www.dotnetcurry.com/tutorials/vsts-tfs">VSTS & TFS</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/entityframework">Entity Framework</a> <a href="https://www.dotnetcurry.com/tutorials/dotnetframework">.NET Framework</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/dotnet-standard-core">.NET Standard & .NET Core</a> </div> </div> </li> <li> <h3>Patterns & Practices</h3> <span class="fa fa-angle-down"></span> <div class="toggle-panel"> <div> <a href="https://www.dotnetcurry.com/tutorials/patterns-practices">Design Patterns</a> <a href="https://www.dotnetcurry.com/tutorials/software-gardening">Software Gardening</a> </div> </div> </li> <li> <h3>Cloud and Mobile</h3> <span class="fa fa-angle-down"></span> <div class="toggle-panel"> <div> <a href="https://www.dotnetcurry.com/tutorials/windows-azure">Microsoft Azure</a> <a href="https://www.dotnetcurry.com/tutorials/xamarin">Xamarin</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/powershell">Powershell</a> <a href="https://www.dotnetcurry.com/tutorials/machine-learning-ai">Machine Learning & AI</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/windows-store">UWP & Windows Store</a> <a href="https://www.dotnetcurry.com/tutorials/windowsphone">Windows Phone</a> </div> </div> </li> <li> <h3>JavaScript</h3> <span class="fa fa-angle-down"></span> <div class="toggle-panel"> <div> <a href="https://www.dotnetcurry.com/tutorials/typescript">TypeScript</a> <a href="https://www.dotnetcurry.com/tutorials/angularjs">Angular</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/jquery-aspnet">jQuery</a> <a href="https://www.dotnetcurry.com/tutorials/nodejs">Node.js</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/reactjs">React.js</a> <a href="https://www.dotnetcurry.com/tutorials/backbonejs">Backbone.js</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/html5-javascript">HTML5 & JavaScript</a> <a href="https://www.dotnetcurry.com/tutorials/bootstrap-css">Bootstrap & CSS</a> </div> </div> </li> <li> <h3>.NET Desktop</h3> <span class="fa fa-angle-down"></span> <div class="toggle-panel"> <div> <a href="https://www.dotnetcurry.com/tutorials/wpf">WPF</a> <a href="https://www.dotnetcurry.com/tutorials/winforms">WinForms</a> </div> </div> </li> <li> <h3>Interview Questions & Product Reviews</h3> <span class="fa fa-angle-down"></span> <div class="toggle-panel"> <div> <a href="https://www.dotnetcurry.com/tutorials/dotnetinterview">.NET Interview Q&A</a> <a href="https://www.dotnetcurry.com/tutorials/product-articles-review">Product Reviews</a> </div> <div> <a href="https://www.dotnetcurry.com/tutorials/general-programming-topics">General Topics</a> </div> </div> </li> </ul> </div> <div class="sec-title"> <h3><b>JOIN OUR COMMUNITY</b></h3> </div> <div class="side-widget"> <div class="side-social"> <a href="https://www.facebook.com/dotnetcurry"><i class="fa fa-facebook"></i> 50K+ <span>fans</span></a> <a href="https://www.twitter.com/dotnetcurry"><i class="fa fa-twitter"></i> 8K+ <span>followers</span></a> <a href="https://www.dotnetcurry.com/magazine/"><i class="fa fa-envelope"></i> 128K+ <span>subscribers</span></a> </div> </div> <div class="sec-title"> <h3><b>POPULAR ARTICLES</b></h3> </div> <div id="latestart" class="side-widget"> <div> <br /> <br /> <br /> </div> </div> <div id='ban-pos-7-600'> </div> <div id='ban-pos-8-600'> </div> <div class="sec-title-plain"> <h4>Tags</h4> </div> <div class="side-widget"> <div class="tags"> <a href="https://www.dotnetcurry.com/tutorials/aspnet-mvc">ASP.NET MVC</a> <a href="https://www.dotnetcurry.com/tutorials/aspnet-core">ASP.NET Core</a> <a href="https://www.dotnetcurry.com/tutorials/aspnet">ASP.NET</a> <a href="https://www.dotnetcurry.com/tutorials/sharepoint">SharePoint</a> <a href="https://www.dotnetcurry.com/tutorials/patterns-practices">Design Patterns</a> <a href="https://www.dotnetcurry.com/tutorials/csharp">C#</a> <a href="https://www.dotnetcurry.com/tutorials/linq">LINQ</a> <a href="https://www.dotnetcurry.com/tutorials/wpf">WPF</a> <a href="https://www.dotnetcurry.com/tutorials/wcf">WCF</a> <a href="https://www.dotnetcurry.com/tutorials/visualstudio">Visual Studio</a> <a href="https://www.dotnetcurry.com/tutorials/vsts-tfs">VSTS & TFS</a> <a href="https://www.dotnetcurry.com/tutorials/windows-azure">Azure</a> <a href="https://www.dotnetcurry.com/tutorials/entityframework">Entity Framework</a> <a href="https://www.dotnetcurry.com/tutorials/angularjs">Angular.js</a> <a href="https://www.dotnetcurry.com/tutorials/reactjs">React.js</a> <a href="https://www.dotnetcurry.com/tutorials/jquery-aspnet">jQuery</a> <a href="https://www.dotnetcurry.com/tutorials/html5-javascript">JavaScript</a> <a href="https://www.dotnetcurry.com/tutorials/html5-javascript">HTML5</a> <a href="https://www.dotnetcurry.com/tutorials/dotnet-standard-core">.NET Core</a> <a href="https://www.dotnetcurry.com/tutorials/dotnetframework">.NET Framework</a> </div> </div> <div class="sec-title"> <h3><b>JQUERY COOKBOOK</b></h3> </div> <div class="side-widget"> <a href="http://www.jquerycookbook.com"><img src="https://www.dotnetcurry.com/images/books/300x300-jqckbk.png" alt="jQuery CookBook" /></a> </div> </div> </div> </div> <!-- container --> </div> <!-- footer --> <footer class="margin-top-30"> <div class="container"> <div class="footer-head"> <div class="row center-content"> <div class="col-md-2 col-sm-3"> <a href="https://www.dotnetcurry.com"> <img data-src="/img/dnc-logo-tee-trans.png" class="img-responsive lazyload" alt="" /> </a> </div> <div class="col-md-6 col-sm-4"> <p></p> </div> <!--<div class="col-md-4 col-sm-5"> <form class="footer-search"> <input type="search" placeholder="Search"> <button type="submit"><i class="fa fa-search"></i></button> </form> </div>--> </div> </div> <div class="footer-content"> <div class="row"> <div class="col-sm-2"> <h5 class="text-white">Server-Side</h5> <ul class="footer-links"> <li><a href="https://www.dotnetcurry.com/tutorials/aspnet">ASP.NET</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/aspnet-core">ASP.NET Core</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/aspnet-mvc">ASP.NET MVC</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/wcf">WCF</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/sharepoint">SharePoint</a></li> </ul> </div> <div class="col-sm-2"> <h5 class="text-white">Client-side</h5> <ul class="footer-links"> <li><a href="https://www.dotnetcurry.com/tutorials/angularjs">Angular.js</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/reactjs">React.js</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/jquery-aspnet">jQuery</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/backbonejs">Backbone.js</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/html5-javascript">HTML5</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/bootstrap-css">CSS</a></li> </ul> </div> <div class="col-sm-2"> <h5 class="text-white">.NET</h5> <ul class="footer-links"> <li><a href="https://www.dotnetcurry.com/tutorials/csharp">C#</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/visualstudio">Visual Studio</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/vsts-tfs">VSTS & TFS</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/linq">LINQ</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/entityframework">Entity Framework</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/dotnetframework">.NET Framework</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/dotnet-standard-core">.NET Standard & .NET Core</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/wpf">WPF</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/winforms">WinForms</a></li> </ul> </div> <div class="col-sm-2"> <h5 class="text-white">Cloud and Mobile</h5> <ul class="footer-links"> <li><a href="https://www.dotnetcurry.com/tutorials/windows-azure">Microsoft Azure</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/devops">DevOps</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/xamarin">Xamarin</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/powershell">Powershell</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/machine-learning-ai">Machine Learning & AI</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/windows-store">UWP & Windows Store</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/windowsphone">Windows Phone</a></li> </ul> </div> <div class="col-sm-2"> <h5 class="text-white">Skill Up</h5> <ul class="footer-links"> <li><a href="https://www.dotnetcurry.com/tutorials/patterns-practices">Design Patterns</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/software-gardening">Software Gardening</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/dotnetinterview">.NET Interview Q&A</a></li> <li><a href="https://www.dotnetcurry.com/magazine/" class="last">Magazines</a></li> <li><a href="http://www.jquerycookbook.com/">Books</a></li> <li><a href="https://www.dotnetcurry.com/tutorials/product-articles-review">Product Reviews</a></li> </ul> </div> <div class="col-sm-2"> <h5 class="text-white">Follow Us</h5> <ul class="footer-social"> <li><a href="https://www.facebook.com/dotnetcurry">Facebook</a></li> <li><a href="https://www.twitter.com/dotnetcurry">Twitter</a></li> <li><a href="https://github.com/dotnetcurry">Github</a></li> </ul> </div> </div> </div> <div class="footer-bottom"> <div class="row"> <div class="col-sm-6"> <p>© 2007-2023 DotNetCurry.com (A subsidiary of A2Z Knowledge Visuals Pvt. Ltd). All rights reserved.</p> </div> <div class="col-sm-6 text-right"> <ul class="list-inline"> <li><a href="https://www.dotnetcurry.com/Contact.aspx">Contact Us</a></li> <li><a href="https://www.dotnetcurry.com/WriteForUs.aspx">Write For Us</a></li> <li><a href="https://www.dotnetcurry.com/PrivacyPolicy.aspx">Privacy</a></li> <li><a href="https://www.dotnetcurry.com/terms-conditions">Terms</a></li> </ul> </div> </div> </div> </div> </footer> <!-- footer --> </form> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js"></script> <script src="/bundles/scriptsmin?v=ztXW8lGCJchjv7iQbaTOZjTpSGfOrLg1lKllrWansXI1"></script> <script src="/bundles/framework?v=yOkBizHgoWwNt4OFd4FauUxu9fucEJ_a4EJrci8uIGA1"></script> <script type="text/javascript"> SyntaxHighlighter.defaults['auto-links'] = false; SyntaxHighlighter.defaults['gutter'] = false; SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all() </script> <script> $(function () { $('.tabHeader').children().first().addClass('current'); $('.tabContent').children().first().addClass('current'); $('.tabHeader li').click(function (e) { e.preventDefault(); $(this).siblings('.current').removeClass('current'); $(this).addClass('current'); $('.tabContent').children('.current').removeClass('current'); $('.tabContent').children().eq($(this).index()).addClass('current'); }); }); </script> <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js"></script> <script> WebFont.load({ google: { families: ['Hind Vadodara:300,400,500,600,700'] } }); </script> </body> </html>