tencent cloud

masukan

Blind Watermark

Terakhir diperbarui:2024-02-02 14:36:36

    Overview

    This document provides an overview of APIs and SDK code samples for blind watermarking.

    Adding Blind Watermark

    Feature description

    You can add a blind watermark when uploading or downloading an object.

    Sample 1: Adding a blind watermark during upload

    PutObjectRequest request = new PutObjectRequest(bucket, key, srcPath);
    
    JObject o = new JObject();
    // Do not return the input image
    o["is_pic_info"] = 0;
    JArray rules = new JArray();
    JObject rule = new JObject();
    rule["bucket"] = bucket;
    rule["fileid"] = key;
    // Processing parameters. For rules, visit https://www.tencentcloud.com/document/product/436/46782?from_cn_redirect=1.
    rule["rule"] = "watermark/3/type/<type>/image/<imageUrl>/text/<text>/level/<level>";
    rules.Add(rule);
    o["rules"] = rules;
    
    string ruleString = o.ToString(Formatting.None);
    request.SetRequestHeader("Pic-Operations", ruleString);
    // Execute the request
    PutObjectResult result = cosXml.PutObject(request);
    Note:
    For more complete samples, visit GitHub.

    Sample 2: Adding a blind watermark during download

    GetObjectRequest getObjectRequest = new GetObjectRequest(bucket, key, localDir, localFileName);
    // Processing parameters. For rules, visit https://www.tencentcloud.com/document/product/436/46782?from_cn_redirect=1.
    getObjectRequest.SetQueryParameter("watermark/3/type/<type>/image/<imageUrl>/text/<text>", null);
    
    GetObjectResult result = cosXml.GetObject(getObjectRequest);
    Note:
    For more complete samples, visit GitHub.
    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24