- Main Page
- Packages
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# smjg.libs.sdwf.cursor_icon.Icon Class Reference

The smjg.libs.sdwf.cursor_icon.Icon class represents an icon image. More...

Inheritance diagram for smjg.libs.sdwf.cursor_icon.Icon:

List of all members.

## Public Member Functions
| this (Application app, uint id)
| Constructs an Icon object from an icon resource.
| this (Application app, string name)
| Constructs an Icon object from an icon resource.
| this (IDI stockIcon)
| Creates an Icon wrapper around the specified stock icon.
| this (Bitmap mask, Bitmap colour)
| Constructs an icon from the given bitmaps.
| this (HICON h, bool autoDelete)
| Constructs an Icon object to wrap the given handle.
| ~this ()
Properties
override Icon | dup ()
| Creates a copy of the icon.
Icon | small ()
| The small (normally 16x16) image of the icon.
override Icon | resize (int width, int height, bool monochrome=false, bool fromResource=true)
| Creates a resized image of the icon.
override Icon | resize (RectDim dim, bool monochrome=false, bool fromResource=true)
| Creates a resized image of the icon.
## Protected Member Functions
| this (Icon orig, int width, int height, uint flags)

## Detailed Description

The smjg.libs.sdwf.cursor_icon.Icon class represents an icon image.

Since:
  0.51

Status:
  experimental

## Constructor & Destructor Documentation

smjg.libs.sdwf.cursor_icon.Icon.this | ( | Application | app,
|  | uint | id |
| ) |  |  |

Constructs an Icon object from an icon resource.

Parameters:

  | app | application containing the icon resource.
  | id | numeric ID of the icon resource.

smjg.libs.sdwf.cursor_icon.Icon.this | ( | Application | app,
|  | string | name |
| ) |  |  |

Constructs an Icon object from an icon resource.

Parameters:

  | app | application containing the icon resource.
  | name | name of the icon resource.

smjg.libs.sdwf.cursor_icon.Icon.this | ( | IDI | stockIcon | ) |

Creates an Icon wrapper around the specified stock icon.

Parameters:

  | stockIcon | value identifying the stock icon to be obtained.

smjg.libs.sdwf.cursor_icon.Icon.this | ( | Bitmap | mask,
|  | Bitmap | colour |
| ) |  |  |

Constructs an icon from the given bitmaps.

Parameters:

  | mask | the AND bitmask of the icon. White pixels correspond to transparent pixels in the resulting icon, and black pixels to opaque ones.
  | colour | the XOR bitmask of the icon. This is the image of the icon on a black background. White pixels in this bitmap corresponding to white pixels in `mask` can be used to create inverse-of-background pixels in the icon.

Precondition:
  `mask` must be a monochrome bitmap.

smjg.libs.sdwf.cursor_icon.Icon.this | ( | HICON | h,
|  | bool | autoDelete |
| ) |  |  |

Constructs an Icon object to wrap the given handle.

Parameters:

  | h | Windows handle of the icon to be wrapped.
  | autoDelete | whether the Windows handle should be automatically deleted when the SDWF object is garbage collected.

smjg.libs.sdwf.cursor_icon.Icon.this | ( | Icon | orig,
|  | int | width,
|  | int | height,
|  | uint | flags |
| ) |  |  | `[protected]`

smjg.libs.sdwf.cursor_icon.Icon.~this | ( |  | ) |

## Member Function Documentation

override Icon smjg.libs.sdwf.cursor_icon.Icon.dup | ( |  | ) | `[virtual]`

Creates a copy of the icon.

Status:
  test

Implements smjg.libs.sdwf.cursor_icon.CursorOrIcon.

Icon smjg.libs.sdwf.cursor_icon.Icon.small | ( |  | ) |

The small (normally 16x16) image of the icon.

Status:
  test

override Icon smjg.libs.sdwf.cursor_icon.Icon.resize | ( | int | width,
|  | int | height,
|  | bool | monochrome = `false`,
|  | bool | fromResource = `true` |
| ) |  |  | `[virtual]`

Creates a resized image of the icon.

Parameters:

  | width | the new width in pixels.
  | height | the new height in pixels.
  | monochrome | whether to convert the icon to monochrome.
  | fromResource | whether to reload the icon from the resource (if applicable) and look for an image of the desired size.

Status:
  test

Implements smjg.libs.sdwf.cursor_icon.CursorOrIcon.

override Icon smjg.libs.sdwf.cursor_icon.Icon.resize | ( | RectDim | dim,
|  | bool | monochrome = `false`,
|  | bool | fromResource = `true` |
| ) |  |  | `[virtual]`

Creates a resized image of the icon.

Parameters:

  | dim | the new dimensions in pixels.
  | monochrome | whether to convert the icon to monochrome.
  | fromResource | whether to reload the icon from the resource (if applicable) and look for an image of the desired size.

Status:
  test

Implements smjg.libs.sdwf.cursor_icon.CursorOrIcon.

The documentation for this class was generated from the following file:

- cursor_icon.d