'PICTURE' Define/Draw Picture
GUI Display/Printer
Formats
1. | Display/Output Picture: | 'PICTURE'([x,y,x,y,] file_and_attrib$[,display_opt]) |
2. | List Embedded Pictures: | variable$='PICTURE'(*) |
Where:
* | Use an * (asterisk) to have the system return a list of its embedded pictures (e.g. X$='PICTURE'(*) PRINT X$). | ||||||||||||||||
x,y,x,y | Point/position coordinates for top left and bottom right, in graphical units. Numeric expressions. Optional when used in List_View text. | ||||||||||||||||
file_and_attrib$ | The graphic file must be specified as either one of the following: • A filename of a graphic (e.g. C:\your_PATH\your.bmp). String expression. The icon filename must have .ico as an extension. • A string consisting of a # and the channel containing the graphic; i.e. the channel opened via *BITMAP*. Attributes can be specified by appending them after the file, separated by commas. Supported attributes are:
| ||||||||||||||||
display_opt | Numeric code used to define style and alignment for use when displaying graphic. Supported options are: 0 = Align at top-left (See Note below) |
Description
Use 'PICTURE' to draw (print) a picture on the device (e.g. terminal). x,y,x,y coordinates define placement and size (top left and bottom right corners). Use graphical units or @X(col) and @Y(line) functions for the various coordinates.
For displaying image transparency, place a G or T at the end of the image filename.
Example:
print 'picture'(1,1,100,100,"myimage.bmp,T",0)
button 10,@(40,2,10,1.6)="{myicon.ico,T,F:V}&Name"For internal images (i.e. those specified with an ! (exclamation point) within braces {!imagename}), it is not necessary to use the G option because the system always assumes this transparency on an internal bitmap unless it is overridden with T. See Internal vs. External Images for information on the handling of internal and external images.
Transparent images are only supported when the picture does not need to be scaled. A scaled image cannot be masked since the scaling process will alter color codes.
To remove an image at x,y,x,y coordinates, use a NULL pathname.
Example:
print 'picture'(1,1,100,100,"")(The ability to use a NULL pathname was added in PxPlus v10.10.)
Hyperlinks
Picture Hyperlinks
If using the LibHaru *PDF* interface, i.e. 'HP' is On, and you print to a *PDF* channel using 'PICTURE' with the <URL> attribute, the picture will become a hyperlink with URL as the destination.
PDF viewer applications will attempt to guess whether a URL is a Web link or a file link. To prevent the PDF viewer application from being incorrect, the recommendation is that you prefix Web links with http://, https:// or ftp:// and prefix file links with file:///.
If you are creating a file link and using the file:/// prefix, you must use an absolute path to the file. However, if you want to use a relative path to the file, do not use the file:/// prefix and instead just specify the relative path. For example, if the open PDF file is in the directory C:\myapp\reports and you want to link to another PDF file called abc.pdf located in C:\myapp\reports\2016, the URL must be specified as 2016\abc.pdf.
Example:
open (pdf_chan)"*PDF*;file=C:\my_app\abc\report.pdf"
print (pdf_chan)'picture'(1,1,100,100,"C:\my_app\abc\resources\mylogo.png,<https://www.mycompany.com>",2)
print (pdf_chan)'picture'(500,800,700,880,"C:\my_app\resources\mapbutton.png,<file:///c:/my_app/abc/map.pdf>")
close (pdf_chan)(Support for picture hyperlinks in PDFs if using LibHaru was added in PxPlus 2019.)