Import images to graph with position and clipping control from LabTalk


Version: 2022b

Type: Features

Category: Analysis

Subcategory: Image Analysis

Jira: ORG-25157


Syntax

  • Crop: gr.Crop(left top right bottom)

  • Clip: gr.Crop$=left top right bottom

Example

win -t plot;
string strInitPath$=system.path.program$+"Samples\Image Processing and Analysis";
dlgfile g:="*.jpg" m:=1 init:=strInitPath$;
int nn=fname.GetNumTokens(CRLF);
int cleft=50, ctop=30, cright=150, cbottom=130;
for(int ii = 1; ii <= nn; ii++) {
	string strf$ = fname.GetToken(ii, CRLF)$;
	string strGr$;
	insertImg2g fname:= strf$ type:=IMG xyp:=page oname:=strGr$;
	GObject gr = strGr$;
	gr.Crop$="$(cleft) $(ctop) $(cright) $(cbottom)"; //Clipping
	int nx = ii*page.width/5;
	int ny = 1000;
	gr.PageRect$="$(nx) $(ny) $(nx+600) $(ny + 600)";
}