[]
        
(Showing Draft Content)

IBackgroundPicture

Interface IBackgroundPicture

All Superinterfaces:
IContainer, IShape

public interface IBackgroundPicture extends IShape
Represents a background picture on a worksheet or chart sheet.

An IBackgroundPicture is a shape in the IBackgroundPictures collection returned by IWorksheet.getBackgroundPictures(). In addition to the members inherited from IShape, it provides background-picture-specific settings such as transparency, image layout, and corner radius.


 IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
 try (InputStream stream = createSampleImageStream()) {
     backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
 }
 IBackgroundPicture picture = backgroundPictures.get(0);
 picture.setTransparency(0.25);
 picture.setBackgroundImageLayout(ImageLayout.Center);
 
  • Method Details

    • getTransparency

      double getTransparency()
      Gets the degree of transparency of the specified picture as a value from 0.0 (opaque) through 1.0 (clear).
      
       IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
       try (InputStream stream = createSampleImageStream()) {
           backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
       }
       IBackgroundPicture picture = backgroundPictures.get(0);
       picture.setTransparency(0.25);
       double transparency = picture.getTransparency();
       
      Returns:
      The degree of transparency of the picture, from 0.0 for a fully opaque picture to 1.0 for a fully clear picture.
    • setTransparency

      void setTransparency(double value)
      Sets the degree of transparency of the specified picture as a value from 0.0 (opaque) through 1.0 (clear).
      
       IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
       try (InputStream stream = createSampleImageStream()) {
           backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
       }
       IBackgroundPicture picture = backgroundPictures.get(0);
       picture.setTransparency(0.6);
       
      Parameters:
      value - The degree of transparency of the picture, from 0.0 for a fully opaque picture to 1.0 for a fully clear picture.
    • getBackgroundImageLayout

      ImageLayout getBackgroundImageLayout()
      Gets a value that describes how an image should be stretched to fill the destination rectangle.

      The returned ImageLayout value controls how the background picture is arranged within its destination rectangle, such as centered, stretched, zoomed, or tiled.

      
       IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
       try (InputStream stream = createSampleImageStream()) {
           backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
       }
       IBackgroundPicture picture = backgroundPictures.get(0);
       picture.setBackgroundImageLayout(ImageLayout.Center);
       ImageLayout layout = picture.getBackgroundImageLayout();
       
      Returns:
      The background image layout for the picture.
    • setBackgroundImageLayout

      void setBackgroundImageLayout(ImageLayout value)
      Sets a value that describes how an image should be stretched to fill the destination rectangle.

      The specified ImageLayout controls how the background picture is arranged within its destination rectangle, such as centered, stretched, zoomed, or tiled.

      
       IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
       try (InputStream stream = createSampleImageStream()) {
           backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
       }
       IBackgroundPicture picture = backgroundPictures.get(0);
       picture.setBackgroundImageLayout(ImageLayout.Center);
       
      Parameters:
      value - The background image layout to apply.
    • getCornerRadius

      int getCornerRadius()
      Gets a value that describes how rounded the corners are on a rectangular die-cut, in pixels.

      This value applies to the rectangular clipping shape used by the background picture. A larger value produces more rounded corners.

      
       IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
       try (InputStream stream = createSampleImageStream()) {
           backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
       }
       IBackgroundPicture picture = backgroundPictures.get(0);
       int cornerRadius = picture.getCornerRadius();
       
      Returns:
      The corner radius of the rectangular die-cut, in pixels.
    • setCornerRadius

      void setCornerRadius(int value)
      Sets a value that describes how rounded the corners are on a rectangular die-cut, in pixels.

      This value applies to the rectangular clipping shape used by the background picture. A larger value produces more rounded corners.

      
       IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
       try (InputStream stream = createSampleImageStream()) {
           backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
       }
       IBackgroundPicture picture = backgroundPictures.get(0);
       picture.setCornerRadius(0);
       
      Parameters:
      value - The corner radius of the rectangular die-cut, in pixels.