I make different controls(InputFields,Text,panel, etc) in my code for which the corresponding code is below.

  inputFieldValue = 10;
  markers = Row[{
                               Style["\[FilledUpTriangle]", Bold, Black, {15,15},ShowStringCharacters -> False],
                                Style["\[FilledDownTriangle]", Bold, Black, {15, 15}, ShowStringCharacters -> False],
                      Spacings -> 0,
                      Alignment -> Center,
                      Background -> RGBColor[0.65, 0.65, 0.65]
                     ](*Column is CLosed*)
               BaselinePosition -> Axis
   field = Dynamic[Row[{InputField[
                            ContinuousAction -> True,
                            ImageSize -> {50, 20},
                            Alignment -> Center
                        BaselinePosition -> Axis

I want to find exact ImageSizes of the controls for accurate placement in another grid. I am listing the options that I have with me here.


     Rasterize[markers][[2, 2]]


    Rasterize[field][[2, 2]]

and also,I arrange this controls in different formats.like,


 userField = Row[{
        Frame -> False


     panelRow = 
            Panel[Row[{userField, userField, userField, userField, userField, 
                  userField, userField, userField, userField, userField
                  FrameMargins -> -3, Appearance -> "Frameless"


 Rasterize[userField][[2, 2]]


Rasterize[panelRow][[2, 2]]

if you evaluate case1,the ImageSize is ({9,23}) which is wrong as I have already mentioned size of markers is {15,15}.

Based on the options provided here, I did try to use the Rasterize function with no success. My idea is to figure out the Imagesize and span them across a layout whose pixel or unit value is 10. Also, if I have an image of an odd dimension, for example, like `ImageSize -> {67, 38}, I want to set my values for the control object to next closest higher multiple of span value, which in the case of my example is {70, 40} so that my control object will not suffer due to insufficient spaces.

Yet another option that I did try was to use Options[markers] which also does not give me the value of the size of the control objects. Right now, I am putting my control objects into Pane with scroll bars to accommodate for different sizes of the control objects without compromising the size or display of the control objects.

  • 2
    $\begingroup$ There's also Rasterize[a, "RasterSize"] if that helps. $\endgroup$
    – Szabolcs
    Feb 28, 2013 at 17:53

1 Answer 1


I don't really know what you're trying to do here, but here's a simple observation on one of the things you're doing:

g = Rasterize[
  Style["\[FilledUpTriangle]", Bold, Black, {15, 15}, 
    ShowStringCharacters -> False]]


The [15,15} appears to be (mostly) ignored, because the resulting graphic is {9,16}.

  • $\begingroup$ ok fine,then How can we estimate the exact size of control objedts? $\endgroup$
    – subbu
    Jan 30, 2013 at 5:29
  • 1
    $\begingroup$ The {15,15} is in the wrong place: g = Rasterize[ Style["[FilledUpTriangle]", Bold, Black, ShowStringCharacters -> False], RasterSize -> {15, 15}] creates a {15,15} image as Szabolcs suggested. $\endgroup$
    – bill s
    Mar 30, 2013 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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