LoadPicture
PowerScript function
Description
Loads a picture from a file or blob into an InkPicture
control.
Applies to
InkPicture controls
Syntax
|
1 |
inkpicname.LoadPicture ( t | b ) |
|
Argument |
Description |
|---|---|
|
inkpicname |
The name of the InkPicture control into which you want to |
|
t |
A string containing the name and location of a file that |
|
b |
The name of a blob passed by reference that contains the |
Return value
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 2 3 |
string ls_path, ls_name GetFileOpenName("Select Image", ls_path, ls_name) ip_1.LoadPicture(ls_path) |
The following example loads an image from a blob:
|
1 2 3 4 5 6 7 8 9 10 |
string ls_path, ls_name integer li_filenum blob lblb_ink GetFileOpenName("Select Ink File", ls_path, ls_name) li_filenum = FileOpen(ls_path, StreamMode!) If li_filenum <> 1 Then FileRead(li_filenum, lblb_ink) FileClose(li_filenum) ip_1.LoadInk(lblb_ink) End If |
See also