1

Is it possible to set an Image as the Background of a Panel? I've studied all the options in the Documentation center, but didn't find anything about it.

  image=Import["https://i.stack.imgur.com/U6Pby.jpg"]

Background Image

  Panel[Style["This is Infratab", 
                Bold, 
                20,
                Editable -> False
               ], 
      Background -> image, Alignment -> Center, ImageSize -> {400, 400}
  ](*panel is closed*)

Instead of a color, I want to set image as background of the Panel.

Sjoerd C. de Vries
  • 65,815
  • 14
  • 188
  • 323
subbu
  • 2,304
  • 1
  • 13
  • 32

2 Answers2

2

You could try theOverlay command:

image = ImageResize[ExampleData[{"TestImage", "Tiffany"}], 300];
Overlay[
 {ImageAdjust[image, {0, 0.5}], 
  Panel[
   Plot[Sin[x], {x, 0, 10},
    PlotStyle -> {Thick, Red}, 
    ImageSize -> ImageDimensions[image]],
   Alignment -> Center,
   ImageSize -> ImageDimensions[image]
   ]}
 ]

enter image description here

cormullion
  • 24,243
  • 4
  • 64
  • 133
1

Something like this:

image = ExampleData[{"TestImage", "Man"}];
Panel[ImageCompose[image,
  Rasterize[Style["This is Infratab", Bold, 20, Yellow], 
   Background -> None]],
 Alignment -> Center, ImageSize -> {400, 400}]

enter image description here

Chris Degnen
  • 30,927
  • 2
  • 54
  • 108