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.

I have created a panel, say Panel[""]. I want to know its size/dimensions. Is there any built-in function for doing that?

share|improve this question
1  
Do you want to interpret a Panel object as an image? It is not a good idea because Panel is a kind of dynamic expression in Mathematica. Only "static" objects have dimensions and size (for example, Image). –  Piotr Semenov Dec 19 '12 at 18:35
1  
The problem here is pretty much the same as in Computing the bounding boxes for Text objects. –  Jens Dec 19 '12 at 18:43
add comment

1 Answer

You could get the size of the rasterized panel:

Rasterize[Panel[""]][[2]]

ImageSize -> {18, 33}

Rasterize[Panel["What is my size?"]][[2]]

ImageSize -> {97, 33}

enter image description here

share|improve this answer
    
Does this operation Resize the actual panel ? –  santhosh Dec 19 '12 at 18:48
    
@santhosh I don't think so. Look at the picture above. –  VLC Dec 19 '12 at 18:54
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.