2.7.64 insertImg2g


Menu Information

Insert: Images From Files...

Brief Information

Insert image from file into a Graph page or Image window.

Additional Information

Minimum Origin Version Required: 2016 SR0

Command Line Usage

1. insertImg2g fname:="C:\image\Sample.bmp";

2. insertImg2g fname:="C:\image\Sample.bmp" ipg:=Graph1;

3. insertImg2g fname:="C:\image\Sample.bmp" type:=img xyp:=2;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
File Name fname

Input

string

fname$
Filename of the image file to be imported.
Input Page ipg

Input

Page

<active>
If you want to import the image into a graph page or a layout page, use this variable to specify the target page.
Object Type type

Input

int

1
Use this variable to specify the inserted object type.


Option list:

  • img{0}: IMG
  • bmp{1}: BMP
Left x

Input

int

-1
x coordinate of top left corner in percentage of page width.
Top y

Input

int

-1
y coordinate of top left corner in percentage of page height.
Coordinate Mode xyp

Input

int

0
Option list:
  • pixel{0}: Pixel
    The unit of the x,y coordinates is pixel
  • page{1}: % of Page
    The unit of the x,y coordinates is percentage of page size.
  • layer{2}: Set as layer background (IMG type only)
    This option will:
    Set image to be behind data, none selectable, and be used as a background
    Set image to attach to layer and scale in stretch mode
    Set the image dimension to be the same as layer axis scale range
    This option is valid when type:=img.
Object Name oname

Output

string

<optional>
Name of string variable to receive the name of the new graph object.

Description

This X-Function can be used to insert an image file outside of Origin in a Graph page or a layout page.

Related X-Functions

cd, impinfo, findFiles, impFile


Keywords:import