InputPictureStream Method

[Top]  [Chapter]  [Previous]  [Next]

Applies to

IWPTextCursor

Declaration

function InputPictureStream(const Stream: IUnknown; const FileExt: WideString; Width: Integer; Height: Integer): Integer;

Description

Insert a picture data specified as Stream.

Parameters

Stream

If you use the OCX you can use any IStream reference.

When using .NET convert an "Stream" using the Stream2WPStream class: TextCursor.InputPictureStream(new WPDynamic.Stream2WPStream(stream1),".PNG",0,0);

FileExt

The file extension - it is used to use the correct loading algorithm.

Width

0 or the desired width in twips

Height

0 or the desired height in twips

Returns

0 if not successful. Otherwise the interface CurrObj can be used to change image properties.

Example:

Create a file stream from an image file and insert it.

       IWPTextCursor TextCursor = WPDLLInt1.Memo.TextCursor;

       FileStream stream = new FileStream(

                      "C:\\WPCubedLogo.jpg",FileMode.Open);

       TextCursor.InputPictureStream(

                       new WPDynamic.Stream2WPStream(stream),"jpg",

               0,0);

       stream.Close();

 

Width and Height are always measured in twips (= 1/1440 inch). If 0, the content width and height will be used.


[idh_iwptextcursor_inputpicturestream.htm]    Copyright © 2007 by WPCubed GmbH