dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
For( iRow = 1, iRow <= N Rows( dt ), irow += 1,
// open the original
original = dt:picture[iRow];
{xSize, ySize} = original << size;
// use a frame to do the drawing, make the original fit the frame exactly
gb = Graph Box(
<<backgroundcolor( "orange" ), // to see errors better
FrameSize( xSize + 1, ySize + 1 ), // the +1 is required, 4 times
X Scale( 0, xSize + 1 ),
Y Scale( 0, ySize + 1 ),
// apparently x and y are different. this is correct in 17EA.
<<Add Image( image( original ), bounds( top( 0 ), Left( 1 ), bottom( ySize ), Right( xSize + 1 ) ) ),
// draw something on top of the image
Text( Center Justified, {xSize / 2, 10}, dt:name[irow] );
);
// capture an updated image
updated = gb[framebox( 1 )] << getpicture;
// crop added border. "updated" is the final image.
updated << crop( Left( 1 ), top( 1 ), Right( xSize + 1 ), bottom( ySize + 1 ) );
dt:picture[irow]=updated;
);
Mug shots
Craige