Beispiel #1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ImageResizer.Plugins.Watermark.WatermarkPlugin w = new ImageResizer.Plugins.Watermark.WatermarkPlugin();
            w.align = System.Drawing.ContentAlignment.BottomLeft;

            w.hideIfTooSmall = false;
            w.keepAspectRatio = true;
            w.valuesPercentages = true;
            w.watermarkDir = "~/";
            w.bottomRightPadding = new System.Drawing.SizeF(0, 0);
            w.topLeftPadding = new System.Drawing.SizeF(0, 0);
            w.watermarkSize = new System.Drawing.SizeF(0.5f, 0.5f);

             //Install the plugin
            w.Install(ImageResizer.Configuration.Config.Current);
        }
Beispiel #2
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ImageResizer.Plugins.Watermark.WatermarkPlugin w = new ImageResizer.Plugins.Watermark.WatermarkPlugin();
            w.align = System.Drawing.ContentAlignment.BottomLeft;

            w.hideIfTooSmall     = false;
            w.keepAspectRatio    = true;
            w.valuesPercentages  = true;
            w.watermarkDir       = "~/";
            w.bottomRightPadding = new System.Drawing.SizeF(0, 0);
            w.topLeftPadding     = new System.Drawing.SizeF(0, 0);
            w.watermarkSize      = new System.Drawing.SizeF(0.5f, 0.5f);

            //Install the plugin
            w.Install(ImageResizer.Configuration.Config.Current);
        }
Beispiel #3
0
        public void Test()
        {
            //
            // TODO: Add test logic here
            //
            Config c = new Config();
            //c.Pipeline.s
            WatermarkPlugin w = new ImageResizer.Plugins.Watermark.WatermarkPlugin();
            w.align = System.Drawing.ContentAlignment.BottomLeft;
            w.hideIfTooSmall = false;
            w.keepAspectRatio = true;
            w.valuesPercentages = true;
            w.watermarkDir = "~/"; //Where the watermark plugin looks for the image specifed in the querystring ?watermark=file.png
            w.bottomRightPadding = new System.Drawing.SizeF(0, 0);
            w.topLeftPadding = new System.Drawing.SizeF(0, 0);
            w.watermarkSize = new System.Drawing.SizeF(1, 1); //The desired size of the watermark, maximum dimensions (aspect ratio maintained if keepAspectRatio = true)
            //Install the plugin
            w.Install(c);

            string imgdir = "..\\..\\..\\Samples\\Images\\";

            c.CurrentImageBuilder.Build(imgdir + "red-leaf.jpg", "red-leaf-watermarked.jpg", new ResizeSettings("watermark=Sun_256.png&width=400"));
        }
Beispiel #4
0
        public void Test()
        {
            //
            // TODO: Add test logic here
            //
            Config c = new Config();
            //c.Pipeline.s
            WatermarkPlugin w = new ImageResizer.Plugins.Watermark.WatermarkPlugin();

            w.align              = System.Drawing.ContentAlignment.BottomLeft;
            w.hideIfTooSmall     = false;
            w.keepAspectRatio    = true;
            w.valuesPercentages  = true;
            w.watermarkDir       = "~/"; //Where the watermark plugin looks for the image specified in the querystring ?watermark=file.png
            w.bottomRightPadding = new System.Drawing.SizeF(0, 0);
            w.topLeftPadding     = new System.Drawing.SizeF(0, 0);
            w.watermarkSize      = new System.Drawing.SizeF(1, 1); //The desired size of the watermark, maximum dimensions (aspect ratio maintained if keepAspectRatio = true)
            //Install the plugin
            w.Install(c);

            string imgdir = "..\\..\\..\\Samples\\Images\\";

            c.CurrentImageBuilder.Build(imgdir + "red-leaf.jpg", "red-leaf-watermarked.jpg", new ResizeSettings("watermark=Sun_256.png&width=400"));
        }