SpreadsheetImageEffects class

SpreadsheetImageEffects class

Represents effects that can be applied to an image watermark for an Excel document.

The SpreadsheetImageEffects type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the SpreadsheetImageEffects class.

Properties

Property Description
border_line_format The line format settings for the image border. Returns an instance of OfficeLineFormat representing the shape line format. (inherited from OfficeImageEffects)
brightness The brightness of the picture. Must be a number from 0.0 (dimmest) to 1.0 (brightest). The default value is 0.5. (inherited from OfficeImageEffects)
chroma_key The color value of the image that will be treated as transparent. (inherited from OfficeImageEffects)
contrast The contrast for the specified picture. Must be a float between 0.0 (least contrast) and 1.0 (greatest contrast). Default is 0.5. (inherited from OfficeImageEffects)
gray_scale The property indicates whether a picture will be displayed in grayscale mode. The default value is False. (inherited from OfficeImageEffects)

Example

import groupdocs.watermark as gw
import groupdocs.watermark.watermarks as gww
import groupdocs.watermark.options.spreadsheet as gwo_xls

load_options = gw.SpreadsheetLoadOptions()
with gw.Watermarker("spreadsheet.xlsx", load_options) as watermarker:
    with gww.ImageWatermark("logo.png") as watermark:
        effects = gwo_xls.SpreadsheetImageEffects()
        effects.brightness = 0.7
        effects.contrast = 0.6
        effects.chroma_key = gww.Color.red
        effects.border_line_format.enabled = True
        effects.border_line_format.weight = 1
        options = gwo_xls.SpreadsheetWatermarkShapeOptions()
        options.effects = effects
        watermarker.add(watermark, options)
    watermarker.save("spreadsheet.xlsx")

See Also