cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

How to overlay picture or text on top of another picture?

miguello
Level VI

I'd like to have a banner as a title of my app with my company's logo. But I would also like to display other image and some text on top of that banner. How can I overlay several display boxes?

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User


Re: How to overlay picture or text on top of another picture?

Maybe this gives some ideas

Names Default To Here(1);

banner = Open("$SAMPLE_IMAGES/tile.jpg", jpg);
banner_extra_image = Open("$SAMPLE_IMAGES/pi.gif", jpg);
banner_text = "Version 1.0.0";

// https://community.jmp.com/t5/Uncharted/Add-Text-to-a-Picture/ba-p/513376
{xSize, ySize} = banner << size;
gb = Graph Box(
	<<backgroundcolor("orange"), 
	FrameSize(xSize + 1, ySize + 1),
	X Scale(0, xSize + 1),
	Y Scale(0, ySize + 1), 
	<< Add Image(image(banner_extra_image), bounds(top(10), Left(1), bottom(10), Right(10))),
	<< Add Image(image(banner), bounds(top(0), Left(0), bottom(ySize), Right(xSize + 1))), 
	Text Color("White"),
	Text Font("Helvetica", 30, "Bold"),
	Text(Counterclockwise, {xSize, 10}, banner_text),
);

updated = gb[framebox(1)] << getpicture;
updated << crop(Left(1), top(1), Right(xSize + 1), bottom(ySize + 1));

nw = New Window("",
	V List Box(
		updated
	)
);

-Jarmo

View solution in original post

6 REPLIES 6
jthi
Super User


Re: How to overlay picture or text on top of another picture?

Depends on how you wish it to look like. Can you provide some sort of mock-up of the final result?

-Jarmo
miguello
Level VI


Re: How to overlay picture or text on top of another picture?

Screenshot 2024-12-11 234904.png

jthi
Super User


Re: How to overlay picture or text on top of another picture?

Do you have banner which covers the whole top part of the app? And you wish to add image/text on top of it?

-Jarmo
miguello
Level VI


Re: How to overlay picture or text on top of another picture?

Yep!

jthi
Super User


Re: How to overlay picture or text on top of another picture?

Maybe this gives some ideas

Names Default To Here(1);

banner = Open("$SAMPLE_IMAGES/tile.jpg", jpg);
banner_extra_image = Open("$SAMPLE_IMAGES/pi.gif", jpg);
banner_text = "Version 1.0.0";

// https://community.jmp.com/t5/Uncharted/Add-Text-to-a-Picture/ba-p/513376
{xSize, ySize} = banner << size;
gb = Graph Box(
	<<backgroundcolor("orange"), 
	FrameSize(xSize + 1, ySize + 1),
	X Scale(0, xSize + 1),
	Y Scale(0, ySize + 1), 
	<< Add Image(image(banner_extra_image), bounds(top(10), Left(1), bottom(10), Right(10))),
	<< Add Image(image(banner), bounds(top(0), Left(0), bottom(ySize), Right(xSize + 1))), 
	Text Color("White"),
	Text Font("Helvetica", 30, "Bold"),
	Text(Counterclockwise, {xSize, 10}, banner_text),
);

updated = gb[framebox(1)] << getpicture;
updated << crop(Left(1), top(1), Right(xSize + 1), bottom(ySize + 1));

nw = New Window("",
	V List Box(
		updated
	)
);

-Jarmo
miguello
Level VI


Re: How to overlay picture or text on top of another picture?

Hmmm.... Very interesting. And yes, it works!