[TYPO3-mvc] Re: How can I create watermark in my extension?

talerKK benbryant098 at yahoo.com
Thu May 16 07:34:01 CEST 2013


I use the following codes to add watermark to images.
http://www.rasteredge.com/how-to/csharp-imaging/create-watermark


using System.IO;
using System.Drawing.Printing;
using RasterEdge.Imaging;
using RasterEdge.Imaging.Processing;

RasterEdgeImaging Image = new RasterEdgeImaging();

//Create an instance of Image and load an existing image
using (Image image= Image.LoadImageFromFile(@"C:\1.bmp"));
            {
                Graphics graphics=new Graphics(image);
                RasterEdgeImaging.Font font = new RasterEdgeImaging.Font("Times New Roman", 16, FontStyle.Bold);
                RasterEdgeImaging.Brushes.SolidBrush brush=new RasterEdgeImaging.Brushes.SolidBrush();
                brush.Color=Color.Black;
                brush.Opacity=100;
                image.CreateWatermark("watermark", font, brush, new PointF(image.Width/2, image.Height/2));
                image.Save(@"C:\1-watermark.bmp");
            }


More information about the TYPO3-project-typo3v4mvc mailing list