InsertPicture
PowerScript function
Description
Inserts an image at the insertion point in a RichTextEdit
control.
Applies to
RichTextEdit controls
Syntax
|
1 |
rtename.InsertPicture ( filename{, format } ) |
|
Argument |
Description |
|---|---|
|
rtename |
The name of the RichTextEdit control in which you want to |
|
filename |
A string whose value is the name of the file that contains |
|
format |
An integer whose value determines the format in which the
|
Return value
Integer. Returns 1 if it succeeds. Returns -2 if the compression
format of a .tif file is not supported and -1 if a different error occurs.
If filename is null, InsertPicture returns null.
Usage
If there is a selection, InsertPicture inserts the image at the
beginning of the selection. The following file types are supported: .bmp,
.wmf, .jpeg, .png, and .gif. The .tif file type is also supported if it
uses the LZW compression format.
Examples
This example inserts a PNG file at the insertion point in the
RichTextEdit control rte_1. The PNG file will be saved in the RTF file in
WMF format:
|
1 2 |
integer li_rtn li_rtn = rte_1.InsertPicture("c:windowsearth.png") |
This example inserts a JPG file at the insertion point in the
RichTextEdit control rte_1. The JPG file will be saved in the RTF file in
JPG format:
|
1 2 |
integer li_rtn li_rtn = rte_1.InsertPicture("c:windowsearth.jpg", 4) |
See also