- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How do add text to a cell that has an image loaded?
12 REPLIES 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do add text to a cell that has an image loaded?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do add text to a cell that has an image loaded?
...and the orange background is because those images have transparent pixels. Your images probably don't have transparent pixels, so you probably won't see that. Preserving the transparency while adding text is a lot harder.
Craige
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do add text to a cell that has an image loaded?
Thanks!
I see!
- « Previous
-
- 1
- 2
- Next »