# Estimate Imagesize of any given Particular Control object?

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

  inputFieldValue = 10;
(*Markers*)
markers = Row[{
Column[{
MouseAppearance[
Style["\[FilledUpTriangle]", Bold, Black, {15,15},ShowStringCharacters -> False],
],
MouseAppearance[
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
];
(*InputField*)
field = Dynamic[Row[{InputField[
Dynamic[inputFieldValue],
Number,
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.

case1:

     Rasterize[markers][[2, 2]]


case2:

    Rasterize[field][[2, 2]]


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

arrange1:

 userField = Row[{
markers,
field
},
Frame -> False
]


arrange2:

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


case3:

 Rasterize[userField][[2, 2]]


case4:

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.

• There's also Rasterize[a, "RasterSize"] if that helps. Feb 28 '13 at 17:53

g = Rasterize[
`