Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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["http://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.

share|improve this question
    
Related: mathematica.stackexchange.com/q/6961/57 –  Sjoerd C. de Vries Nov 28 '12 at 13:30
add comment

2 Answers

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

share|improve this answer
    
,sorry your code is also not working.I evaluated your code in my system. –  subbu Nov 28 '12 at 15:40
    
try restarting Mathematica? –  cormullion Nov 28 '12 at 15:53
    
Already I tried ,still not working. –  subbu Nov 28 '12 at 18:20
    
works for me, MacOS X Mountain Lion, Mathematica 8.0.1. Sorry, can't help. –  cormullion Nov 28 '12 at 19:58
    
@subbu What is your mma version? Is it a previous one than 8? Overlay is introduced in version 8. –  Silvia Dec 1 '12 at 10:52
show 2 more comments

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

share|improve this answer
    
,you are specifying image as data with in panel,but I want to set image as Background to the Panel. –  subbu Nov 28 '12 at 11:44
    
@ subbu - That isn't possible. Background is just for colours. –  Chris Degnen Nov 28 '12 at 11:50
    
,that was I Know,just I am trying is it possible or not? –  subbu Nov 28 '12 at 12:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.