org.apache.poi.hwmf.record

## Class HwmfMisc.WmfDibCreatePatternBrush

- java.lang.Object
- - org.apache.poi.hwmf.record.HwmfMisc.WmfDibCreatePatternBrush

- All Implemented Interfaces:
    GenericRecord, HwmfFill.HwmfImageRecord, HwmfObjectTableEntry, HwmfRecord
  Direct Known Subclasses:
    HemfMisc.EmfCreateDibPatternBrushPt
  Enclosing class:
    HwmfMisc

      public static class HwmfMisc.WmfDibCreatePatternBrush
      extends java.lang.Object
      implements HwmfRecord, HwmfFill.HwmfImageRecord, HwmfObjectTableEntry

  The META_DIBCREATEPATTERNBRUSH record creates a Brush Object with a pattern specified by a DeviceIndependentBitmap (DIB) Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected HwmfFill.ColorUsage` | `colorUsage` A 16-bit unsigned integer that defines whether the Colors field of a DIB Object contains explicit RGB values, or indexes into a palette.
    `protected HwmfBitmapDib` | `patternDib`
    `protected HwmfBrushStyle` | `style`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WmfDibCreatePatternBrush()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `applyObject(HwmfGraphics ctx)`
    `void` | `draw(HwmfGraphics ctx)` Apply the record settings to the graphics context
    `byte[]` | `getBMPData()`
    `HwmfFill.ColorUsage` | `getColorUsage()`
    `java.util.Map<java.lang.String,java.util.function.Supplier<?>>` | `getGenericProperties()`
    `java.awt.image.BufferedImage` | `getImage(java.awt.Color foreground, java.awt.Color background, boolean hasAlpha)` Provide an image using the fore-/background color, in case of a 1-bit pattern
    `HwmfBrushStyle` | `getStyle()`
    `HwmfRecordType` | `getWmfRecordType()`
    `int` | `init(LittleEndianInputStream leis, long recordSize, int recordFunction)` Init record from stream

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

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

    - ### Methods inherited from interface org.apache.poi.hwmf.record.HwmfRecord

      `getGenericRecordType`

    - ### Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord

      `getGenericChildren`

    - ### Methods inherited from interface org.apache.poi.hwmf.record.HwmfFill.HwmfImageRecord

      `getImage`

- - ### Field Detail

    - #### style

          protected HwmfBrushStyle style

    - #### colorUsage

          protected HwmfFill.ColorUsage colorUsage

      A 16-bit unsigned integer that defines whether the Colors field of a DIB Object contains explicit RGB values, or indexes into a palette. If the Style field specifies BS_PATTERN, a ColorUsage value of DIB_RGB_COLORS MUST be used regardless of the contents of this field. If the Style field specified anything but BS_PATTERN, this field MUST be one of the ColorUsage values.

    - #### patternDib

          protected HwmfBitmapDib patternDib

  - ### Constructor Detail

    - #### WmfDibCreatePatternBrush

          public WmfDibCreatePatternBrush()

  - ### Method Detail

    - #### getWmfRecordType

          public HwmfRecordType getWmfRecordType()

      Specified by:
        `getWmfRecordType` in interface `HwmfRecord`

    - #### init

          public int init(LittleEndianInputStream leis,
                          long recordSize,
                          int recordFunction)
                   throws java.io.IOException

      Description copied from interface: `HwmfRecord`
      Init record from stream
      Specified by:
        `init` in interface `HwmfRecord`
      Parameters:
        `leis` - the little endian input stream
      Returns:
        count of processed bytes
      Throws:
        `java.io.IOException`

    - #### draw

          public void draw(HwmfGraphics ctx)

      Description copied from interface: `HwmfRecord`
      Apply the record settings to the graphics context
      Specified by:
        `draw` in interface `HwmfRecord`
      Parameters:
        `ctx` - the graphics context to modify

    - #### applyObject

          public void applyObject(HwmfGraphics ctx)

      Specified by:
        `applyObject` in interface `HwmfObjectTableEntry`

    - #### getImage

          public java.awt.image.BufferedImage getImage(java.awt.Color foreground,
                                                       java.awt.Color background,
                                                       boolean hasAlpha)

      Description copied from interface: `HwmfFill.HwmfImageRecord`
      Provide an image using the fore-/background color, in case of a 1-bit pattern
      Specified by:
        `getImage` in interface `HwmfFill.HwmfImageRecord`
      Parameters:
        `foreground` - the foreground color
        `background` - the background color
        `hasAlpha` - if true, the background color is rendered transparent - see `HwmfMisc.WmfSetBkMode.HwmfBkMode`
      Returns:
        the image

    - #### getBMPData

          public byte[] getBMPData()

      Specified by:
        `getBMPData` in interface `HwmfFill.HwmfImageRecord`
      Returns:
        the raw BMP data
      See Also:
        BMP format

    - #### getStyle

          public HwmfBrushStyle getStyle()

    - #### getColorUsage

          public HwmfFill.ColorUsage getColorUsage()

    - #### getGenericProperties

          public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()

      Specified by:
        `getGenericProperties` in interface `GenericRecord`

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