Picture
- Updated2025-07-21
- 2 minute(s) read
Picture
A Picture object specifies an image. Microsoft defines this standard Picture object implementation in the Object Linking and Embedding (OLE) Automation Version 2.0 type library file, stdole2.tlb . Picture objects provide a language-neutral abstraction for bitmaps, icons, and metafiles. Refer to Microsoft documentation for more information about this interface.
The Picture interface specifies the following properties and methods:
Properties
- Handle (Read Only) —Returns the Microsoft Windows graphics device interface (GDI) handle of the image managed within the Picture object.
- Attributes (Read Only) —Returns the attributes of the image.
- CurDC —Specifies the current device context into which this image is selected.
- Height (Read Only) —Returns the current height of the image in the Picture object.
- Hpal —Specifies the current palette the Picture object uses.
- Type (Read Only) —Returns the current type of the image.
- Width (Read Only) —Returns the current width of the image in the Picture object.
- KeepOriginalFormat —Specifies whether the image maintains the original format.
Methods
- Render —Draws the specified portion of the image onto the specified device context, positioned at the specified location.
- SelectPicture —Selects a bitmap image into a given device context, returning the device context in which the image was previously selected as well as the GDI handle of the image.
- PictureChanged —Notifies the Picture object that its image resource changed.
- SaveAsFile —Saves the image data into a stream in the same format as it would save itself into a file.
LabVIEW
The LabVIEW development environment automatically recognizes Picture ActiveX references. Use the Invoke Node and Property Node VIs to access the methods and properties of a Picture ActiveX reference.
LabWindows/CVI
LabWindows/CVI creates and accesses ActiveX objects using functions in a LabWindows/CVI-generated driver. You must create a driver for the OLE Automation ActiveX server using the ActiveX Controller Wizard. Select Tools»Create ActiveX Controller to launch the wizard, select OLE Automation in the ActiveX Server list control, and proceed to build the driver. Use the functions for the Picture class to access the methods and properties.
Microsoft Visual Basic .NET
In Microsoft Visual Basic .NET, you can access Picture objects by first adding the OLE Automation COM component as a reference in a project and then adding the following directive at the top of the source file:
Imports stdole.StdPictureClass
The IPictureDisp class and its methods and properties are available in the Microsoft Visual Studio object browser and are accessible from the Visual Basic .NET source code.
C#
In C#, you can access Picture objects by first adding the OLE Automation COM component as a reference in a project and then adding the following directive at the top of the source file:
using stdole.StdPictureClass;
The IPictureDisp class and its methods and properties are available in the Visual Studio object browser and are accessible from the C# source code.
Microsoft Visual C++/#import
In C++, you can access Picture objects by adding the include file ocidl.h and using the CComPtr template to manage IPictureDisp COM interface pointers.