/// <summary>
 /// Applies a watermark to a given image.
 /// </summary>
 /// <param name="processingContext">The image processing context.</param>
 /// <param name="font">The font the watermark should be in.</param>
 /// <param name="text">The watermark text.</param>
 /// <param name="color">The HTML encoded color (e.g. '#123456').</param>
 /// <param name="padding">The padding in pixels.</param>
 /// <param name="wordwrap">True if the words should be wrapped.</param>
 /// <returns>The input <see cref="IImageProcessingContext"/>.</returns>
 public static IImageProcessingContext ApplyScalingWaterMark(this IImageProcessingContext processingContext,
                                                             Font font,
                                                             string text,
                                                             Color color,
                                                             float padding,
                                                             bool wordwrap) =>
 wordwrap
         ? processingContext.ApplyScalingWaterMarkWordWrap(font, text, color, padding)
         : processingContext.ApplyScalingWaterMarkSimple(font, text, color, padding);
예제 #2
0
 public static IImageProcessingContext <TPixel> ApplyScalingWaterMark <TPixel>(this IImageProcessingContext <TPixel> processingContext, Font font, string text, TPixel color, float padding, bool wordwrap)
     where TPixel : struct, IPixel <TPixel>
 {
     if (wordwrap)
     {
         return(processingContext.ApplyScalingWaterMarkWordWrap(font, text, color, padding));
     }
     else
     {
         return(processingContext.ApplyScalingWaterMarkSimple(font, text, color, padding));
     }
 }
예제 #3
0
 private static IImageProcessingContext ApplyScalingWaterMark(this IImageProcessingContext processingContext,
                                                              Font font,
                                                              string text,
                                                              Color color,
                                                              float padding,
                                                              bool wordwrap)
 {
     if (wordwrap)
     {
         return(processingContext.ApplyScalingWaterMarkWordWrap(font, text, color, padding));
     }
     else
     {
         return(processingContext.ApplyScalingWaterMarkSimple(font, text, color, padding));
     }
 }
 public static void ApplyScalingWaterMark <TPixel>(this IImageProcessingContext <TPixel> p_processingContext,
                                                   Font p_font,
                                                   string p_text, TPixel p_fontColor,
                                                   TPixel p_backgroundColor,
                                                   float p_padding, bool p_wordwrap,
                                                   float p_targetSize)
     where TPixel : struct, IPixel <TPixel>
 {
     if (p_wordwrap)
     {
         p_processingContext.ApplyScalingWaterMarkWordWrap(p_font, p_text, p_fontColor, p_padding);
     }
     else
     {
         p_processingContext.ApplyScalingWaterMarkSimpleTopLeft(p_font, p_text, p_fontColor, p_backgroundColor, p_targetSize);
     }
 }