Class

# IPicture

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

<span class="title-ref">IPicture</span> is the primary interface implemented by the OLE-provided picture object. It allows the caller to manage picture properties and to use that picture in graphical rendering.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                      | Type                                        | Read-Only | Shared |
|---------------------------|---------------------------------------------|-----------|--------|
| `Handle<ipicture.handle>` | `Ptr</api/data_types/additional_types/ptr>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                      | Parameters                                                                                                                           | Returns                                           | Shared |
|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|--------|
| `AddRef<ipicture.addref>`                 |                                                                                                                                      | `UInt32</api/data_types/additional_types/uint32>` |        |
| `Constructor<ipicture.constructor0>`      | p As `Ptr</api/data_types/additional_types/ptr>`                                                                                     |                                                   |        |
| `QueryInterface<ipicture.queryinterface>` | riid As `Ptr</api/data_types/additional_types/ptr>`, `ByRef</api/language/byref>` out As `Ptr</api/data_types/additional_types/ptr>` | `Integer</api/data_types/integer>`                |        |
| `Release<ipicture.release>`               |                                                                                                                                      | `UInt32</api/data_types/additional_types/uint32>` |        |

## Property descriptions

<div id="ipicture.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IPicture.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> Returns the raw IUnknown pointer.

## Method descriptions

<div id="ipicture.addref">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IPicture.AddRef

**AddRef** As `UInt32</api/data_types/additional_types/uint32>`

> Increments a reference count and returns the value of the reference count.

<div id="ipicture.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IPicture.Constructor

**Constructor**(p As `Ptr</api/data_types/additional_types/ptr>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Creates a new IUnknown class from the supplied pointer. The constructor does not automatically add a reference count, but when the destructor is called a reference is released.

<div id="ipicture.queryinterface">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IPicture.QueryInterface

**QueryInterface**(riid As `Ptr</api/data_types/additional_types/ptr>`, `ByRef</api/language/byref>` out As `Ptr</api/data_types/additional_types/ptr>`) As `Integer</api/data_types/integer>`

> Retrieves the address of a specified interface.
>
> The following automates Internet Explorer and queries for a specific interface (each interface is identified by a unique IID)
>
> ``` xojo
> Var ie As New OLEObject("InternetExplorer.Application")
> ie.Visible = True
> ie.Navigate("google.com")
>
> Var unk As New COM.IUnknown(ie.Handle)
>
> ' Query for the IID_IWebBrowser2 interface
> Var iid As MemoryBlock = COM.IIDFromString("{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")
> Var out As Ptr
> If 0 = unk.QueryInterface(iid, out) Then
>    ' Yay this interface exists
>    Break
> End If
> ```

<div id="ipicture.release">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IPicture.Release

**Release** As `UInt32</api/data_types/additional_types/uint32>`

> Decrements a reference count and returns the value of the reference count.

## Compatibility

|                       |         |
|-----------------------|---------|
| **Project Types**     | Desktop |
| **Operating Systems** | Windows |

<div class="seealso">

`IUnknown</api/windows/iunknown>` parent class; `COM</api/windows/com>` module; `IDispatch</api/windows/idispatch>`, `IEnumVARIANT</api/windows/ienumvariant>`, `IUnknown</api/windows/iunknown>`.

</div>
