org.apache.poi.sl.draw

## Class DrawPictureShape

- java.lang.Object
- - org.apache.poi.sl.draw.DrawShape
  - - org.apache.poi.sl.draw.DrawSimpleShape
    - - org.apache.poi.sl.draw.DrawPictureShape

- All Implemented Interfaces:
    Drawable

      public class DrawPictureShape
      extends DrawSimpleShape

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.poi.sl.draw.Drawable

      `Drawable.DrawableHint`

  - ### Field Summary

    - ### Fields inherited from class org.apache.poi.sl.draw.DrawShape

      `shape`

    - ### Fields inherited from interface org.apache.poi.sl.draw.Drawable

      `BUFFERED_IMAGE, CURRENT_SLIDE, DRAW_FACTORY, FONT_FALLBACK, FONT_HANDLER, FONT_MAP, GRADIENT_SHAPE, GRESTORE, GROUP_TRANSFORM, GSAVE, IMAGE_RENDERER, PRESET_GEOMETRY_CACHE, TEXT_AS_CHARACTERS, TEXT_AS_SHAPES, TEXT_RENDERING_MODE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DrawPictureShape(PictureShape<?,?> shape)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `drawContent(java.awt.Graphics2D graphics)` draw any content within this shape (image, text, etc.).
    `protected java.awt.Paint` | `getFillPaint(java.awt.Graphics2D graphics)`
    `static ImageRenderer` | `getImageRenderer(java.awt.Graphics2D graphics, java.lang.String contentType)` Returns an ImageRenderer for the PictureData
    `protected PictureShape<?,?>` | `getShape()`
    `void` | `resize()` Resize this picture to the default size.
    `void` | `resize(java.awt.geom.Rectangle2D target)` Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.
    `void` | `resize(java.awt.geom.Rectangle2D target, RectAlign align)` Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle based on the specified alignment (gravity).

    - ### Methods inherited from class org.apache.poi.sl.draw.DrawSimpleShape

      `computeOutlines, draw, drawDecoration, drawShadow, getHeadDecoration, getLinePaint, getStroke, getTailDecoration`

    - ### Methods inherited from class org.apache.poi.sl.draw.DrawShape

      `applyTransform, getAnchor, getAnchor, getStroke`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DrawPictureShape

          public DrawPictureShape(PictureShape<?,?> shape)

  - ### Method Detail

    - #### drawContent

          public void drawContent(java.awt.Graphics2D graphics)

      Description copied from interface: `Drawable`
      draw any content within this shape (image, text, etc.).
      Specified by:
        `drawContent` in interface `Drawable`
      Overrides:
        `drawContent` in class `DrawShape`
      Parameters:
        `graphics` - the graphics to draw into

    - #### getImageRenderer

          public static ImageRenderer getImageRenderer(java.awt.Graphics2D graphics,
                                                       java.lang.String contentType)

      Returns an ImageRenderer for the PictureData
      Parameters:
        `graphics` - the graphics context
      Returns:
        the image renderer

    - #### getFillPaint

          protected java.awt.Paint getFillPaint(java.awt.Graphics2D graphics)

      Overrides:
        `getFillPaint` in class `DrawSimpleShape`

    - #### getShape

          protected PictureShape<?,?> getShape()

      Overrides:
        `getShape` in class `DrawSimpleShape`

    - #### resize

          public void resize()

      Resize this picture to the default size. For PNG and JPEG resizes the image to 100%, for other types, if the size can't be determined it will be 200x200 pixels.

    - #### resize

          public void resize(java.awt.geom.Rectangle2D target)

      Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle with a centered alignment.
      Parameters:
        `target` - The target rectangle

    - #### resize

          public void resize(java.awt.geom.Rectangle2D target,
                             RectAlign align)

      Fit picture shape into the target rectangle, maintaining the aspect ratio and repositioning within the target rectangle based on the specified alignment (gravity).
      Parameters:
        `target` - The target rectangle
        `align` - The alignment within the target rectangle when resizing. A null value corresponds to RectAlign.CENTER

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.