如何从文本框中添加水印到拍摄照片?

时间:2015-07-28 13:55:00

标签: vb.net image textbox windows-phone watermark

如何将文本框中的文本放在捕获的图像上? 是否可以将其实现为代码来自: Vb app code

1 个答案:

答案 0 :(得分:1)

您可以使用Bytescout.Watermarking SDK for .NET轻松完成此操作

以下是代码`Imports System.Diagnostics的示例 进口Bytescout.Watermarking Imports Bytescout.Watermarking.Presets

Module Module1

Sub Main()
' Create new watermarker
    Dim waterMarker As New Watermarker()
' Create new preset
    Dim preset As New TextFitsPage()
' Create new string
    Dim inputFilePath As String
' Create new string
    Dim outputFilePath As String

    ' Set input file path
    inputFilePath = "my_sample_image.jpg" '<-- place your captured image here
    ' Set output file path
    outputFilePath = "my_sample_output.jpg"

    ' Initialize library
    waterMarker.InitLibrary("demo", "demo")

    ' Add image to apply watermarks to
    waterMarker.AddInputFile(inputFilePath, outputFilePath)

    ' Set preset text
    preset.Text = "Bytescout Watermarking" '<-- place your textbox.text here

    ' Add watermark to watermarker
    waterMarker.AddWatermark(preset)

    ' Set output directory
    waterMarker.OutputOptions.OutputDirectory = "."

    ' Apply watermarks
    waterMarker.Execute()

    ' Open generated image file in default image viewer installed in Windows
    Process.Start(outputFilePath)

End Sub

End Module`

来源:how to add a simple transparent watermark