OleLoadPictureFileEx
Collapse the table of content
Expand the table of content

OleLoadPictureFileEx function

Loads a picture from a file.

Syntax


HRESULT OleLoadPictureFileEx(
  _In_  VARIANT    varFileName,
  _In_  DWORD      xSizeDesired,
  _In_  DWORD      ySizeDesired,
  _In_  DWORD      dwFlags,
  _Out_ LPDISPATCH *lplpdispPicture
);

Parameters

varFileName [in]

The path and name of the picture file to load.

xSizeDesired [in]

The desired length for the picture to be displayed.

ySizeDesired [in]

The desired height for the picture to be displayed.

dwFlags [in]

The desired color depth for the icon or cursor. Together with the desired size it is used to select the best matching image.

ValueMeaning
LP_MONOCHROME

Creates a monochrome picture to display on a monitor.

LP_VGACOLOR

Creates a 16-color picture to display on a monitor.

LP_COLOR

Creates a 256-color picture to display on a monitor.

LP_DEFAULT

Selects the best color depth to use for the current display.

 

lplpdispPicture [out]

The location that receives a pointer to the picture.

Return value

This method returns standard COM error codes in addition to the following values.

Return codeDescription
S_OK

The method completed successfully.

DISP_E_PARAMNOTFOUND

varFileName is not valid.

 

Remarks

Recognized graphic formats include bitmap (.bmp), JPEG (.jpg), GIF (.gif), and PGN (.png) files.

Requirements

Header

OleCtl.h

Library

OleAut32.lib

DLL

OleAut32.dll

 

 

Community Additions

ADD
Show:
© 2016 Microsoft