Class: GdiBitmap | Spider Monkey Panel

## GdiBitmap(arg)

#### new GdiBitmap(arg)
`js/foo_spider_monkey_panel.js`, `line 2796`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `arg` | GdiBitmap |

### Members

#### readonly Height :number
`js/foo_spider_monkey_panel.js`, `line 2802`

#### readonly Width :number
`js/foo_spider_monkey_panel.js`, `line 2808`

### Methods

#### ApplyAlpha(alpha) → {GdiBitmap}
`js/foo_spider_monkey_panel.js`, `line 2814`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `alpha` | number | Valid values 0-255.

  ##### Returns:

  GdiBitmap

#### ApplyMask(img)
`js/foo_spider_monkey_panel.js`, `line 2824`

  Changes will be saved in the current bitmap.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `img` | GdiBitmap |

  ##### Example

      <caption>Blur image<caption>
      // See `samples/basic/Apply Mask.js`

#### Clone(x, y, w, h) → {GdiBitmap}
`js/foo_spider_monkey_panel.js`, `line 2833`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `x` | number |
  `y` | number |
  `w` | number |
  `h` | number |

  ##### Returns:

  GdiBitmap

#### CreateRawBitmap() → {GdiRawBitmap}
`js/foo_spider_monkey_panel.js`, `line 2840`

  Create a DDB bitmap from GdiBitmap, which is used in GdiGraphics#GdiDrawBitmap

  ##### Returns:

  GdiRawBitmap

#### GetColourScheme(max_count) → {Array.<number>}
`js/foo_spider_monkey_panel.js`, `line 2846`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `max_count` | number |

  ##### Returns:

  Array.<number>

#### GetColourSchemeJSON(max_count) → {string}
`js/foo_spider_monkey_panel.js`, `line 2866`

  Returns a JSON array in string form so you need to use JSON.parse() on the result.
  Each entry in the array is an object which contains colour and frequency values.
  Uses a different method for calculating colours than GdiBitmap#GetColourScheme.
  Image is automatically resized during processing for performance reasons so there's no need to resize before calling the method.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `max_count` | number |

  ##### Returns:

  string

  ##### Example

      // See docs\Helpers.js for "toRGB" function.
      img = ... // use utils.GetAlbumArtV2 / gdi.Image / etc
      colours = JSON.parse(img.GetColourSchemeJSON(5));
      console.log(colours[0].col); // -4194304
      console.log(colours[0].freq); // 0.34
      console.log(toRGB(colours[0].col)); // [192, 0, 0]

#### GetGraphics() → {GdiGraphics}
`js/foo_spider_monkey_panel.js`, `line 2873`

  Note: don't forget to use GdiBitmap#ReleaseGraphics after work on GdiGraphics is done!

  ##### Returns:

  GdiGraphics

#### InvertColours() → {GdiBitmap}
`js/foo_spider_monkey_panel.js`, `line 2880`

  Inverts the colours in a bitmap, to create a negative image. i.e. White becomes black, black becomes white, etc.

  ##### Returns:

  GdiBitmap

#### ReleaseGraphics(gr)
`js/foo_spider_monkey_panel.js`, `line 2885`

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `gr` | GdiGraphics |

#### Resize(w, h, modeopt) → {GdiBitmap}
`js/foo_spider_monkey_panel.js`, `line 2893`

  ##### Parameters:

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `w` | number |  |  |
  `h` | number |  |  |
  `mode` | number | <optional> | 0 | See Flags.js > InterpolationMode

  ##### Returns:

  GdiBitmap

#### RotateFlip(mode)
`js/foo_spider_monkey_panel.js`, `line 2900`

  Changes will be saved in the current bitmap.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `mode` | number | See Flags.js > RotateFlipType

#### SaveAs(path, formatopt) → {boolean}
`js/foo_spider_monkey_panel.js`, `line 2918`

  ##### Parameters:

  Name | Type | Attributes | Default | Description
  --- | --- | --- | --- | ---
  `path` | string |  |  | Full path including file extension. The parent folder must already exist.
  `format` | string | <optional> | 'image/png' | "image/png" "image/bmp" "image/jpeg" "image/gif" "image/tiff"

  ##### Returns:

  boolean

  ##### Example

      let img = utils.GetAlbumArtEmbedded(fb.GetFocusItem().RawPath, 0);
      if (img) {
          img.SaveAs("D:\\export.jpg", "image/jpeg");
      }

#### StackBlur(radius)
`js/foo_spider_monkey_panel.js`, `line 2931`

  Changes will be saved in the current bitmap.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `radius` | number | Valid values 2-254.

  ##### Examples

      <caption>Blur image<caption>
      // `samples/basic/StackBlur (image).js`

      <caption>Blur text<caption>
      // `samples/basic/StackBlur (text).js`