LoadPicture PowerScript function
Description
Loads a picture from a file or blob into an InkPicture control.
Controls
InkPicture controls
Syntax
|
1 |
<span>inkpicname</span>.LoadPicture (<span></span> <span>t</span> | <span>b</span> ) |
|
Argument |
Description |
|---|---|
|
inkpicname |
The name of the InkPicture control into |
|
t |
A string containing the name and location |
|
b |
The name of a blob passed by reference |
Return Values
Integer. Returns 1 for success and -1
for failure.
Usage
Use the LoadPicture function to load an
image into an InkPicture control.
Examples
The following example loads an image from a file.
Since the user will select a single file, the second argument to GetFileOpenName contains
the file’s path and its name, so the third argument can
be ignored:
|
1 |
string ls_path, ls_name<br>GetFileOpenName("Select Image", ls_path, ls_name)<br>ip_1.LoadPicture(ls_path) |
The following example loads an image from a blob:
|
1 |
string ls_path, ls_name<br>integer li_filenum<br>blob lblb_ink<br> <br>GetFileOpenName("Select Ink File", ls_path, ls_name)<br>li_filenum = FileOpen(ls_path, StreamMode!)<br>If li_filenum <> 1 Then<br>   FileRead(li_filenum, lblb_ink)<br>   FileClose(li_filenum)<br>   ip_1.LoadInk(lblb_ink)<br>End If |