AppStream.Component.get_icon_by_size

### Method

# AppStream Componentget_icon_by_size

#### Declaration [src]

    AsIcon*
    as_component_get_icon_by_size (
      AsComponent* cpt,
      guint width,
      guint height
    )

#### Description [src]

Gets an icon matching the size constraints. The icons are not filtered by type, and the first icon which matches the size is returned. If you want more control over which icons you use for displaying, use the %as_component_get_icons() function to get a list of all icons.

Note that this function is not HiDPI aware! It will never return an icon with a scaling factor > 1.

#### Parameters

`width`

  Type: `guint`

  The icon width in pixels.

`height`

  Type: `guint`

  The icon height in pixels.

#### Return value

Type: `AsIcon`

An icon matching the given width/height, or `NULL` if not found.

The returned data is owned by the instance.
The return value can be `NULL`.