UtilAsposeAddTextWatermark(Image, String, Font, Color, WatermarkPosition, Single, Single) Method
Adds a text watermark at a prefedined position into an image.
Namespace: DevCase.ThirdParty.AsposeAssembly: DevCase.net48.ThirdParty.Aspose (in DevCase.net48.ThirdParty.Aspose.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Image AddTextWatermark(
Image img,
string text,
Font fnt,
Color color,
WatermarkPosition position,
float verticalmargin = 0f,
float horizontalmargin = 0f
)
Public Shared Function AddTextWatermark (
img As Image,
text As String,
fnt As Font,
color As Color,
position As WatermarkPosition,
Optional verticalmargin As Single = 0F,
Optional horizontalmargin As Single = 0F
) As Image
Dim img As Image
Dim text As String
Dim fnt As Font
Dim color As Color
Dim position As WatermarkPosition
Dim verticalmargin As Single
Dim horizontalmargin As Single
Dim returnValue As Image
returnValue = UtilAspose.AddTextWatermark(img,
text, fnt, color, position, verticalmargin,
horizontalmargin)
public:
static Image^ AddTextWatermark(
Image^ img,
String^ text,
Font^ fnt,
Color color,
WatermarkPosition position,
float verticalmargin = 0f,
float horizontalmargin = 0f
)
static member AddTextWatermark :
img : Image *
text : string *
fnt : Font *
color : Color *
position : WatermarkPosition *
?verticalmargin : float32 *
?horizontalmargin : float32
(* Defaults:
let _verticalmargin = defaultArg verticalmargin 0f
let _horizontalmargin = defaultArg horizontalmargin 0f
*)
-> Image
No code example is currently available or this language may not be supported.
- img Image
-
The source image.
- text String
-
The watermark text.
- fnt Font
-
The watermark font.
- color Color
-
The watermark color.
- position WatermarkPosition
-
The watermark position.
- verticalmargin Single (Optional)
-
The watermark vertical margin.
- horizontalmargin Single (Optional)
-
The watermark horizontal margin.
Image
The resulting
Image.
Note: Some functionalities of this assembly may require to install one or all of the listed NuGet packages:
Aspose.Imaging by Aspose
This is a code example.
No code example is currently available or this language may not be supported.
' Load an image to add a watermark.
Dim img As Aspose.Imaging.Image = Aspose.Imaging.Image.Load("C:\image.bmp")
' Set the watermark text.
Dim text As String = "ElektroStudios"
' Set the watermark text color.
Dim color As Global.Aspose.Imaging.Color = Aspose.Imaging.Color.White
' Set the watermark text font.
Dim fnt As New Aspose.Imaging.Font("Lucida Console", 32, FontStyle.Bold)
' Add the watermark into the image.
img = AddTextWatermark(img:=img, text:=text, fnt:=fnt, color:=color, position:=WatermarkPosition.BottomRight)
' Save the image to disk.
img.Save("C:\Watermark.bmp")
' See the resulting image.
Process.Start("C:\Watermark.bmp")
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.