Basic Examples (5)
Get the bounding box size of the current cell:
Generate an output cell with some text:
Get the bounding box size of the text in printer's points:
Take some image object and adjust its size manually:
Get the current bounding box size of the object and specify it as ImageSize:
First, produce an output cell:
Get the current absolute wrapping width of the produced cell and specify it as ImageFormattingWidth for Rasterize in order to reproduce the current view:
Specify the current absolute wrapping width of the output cell as ImageSize for Pane, in order to reproduce the current wrapping independently of the WindowSize:
Applications (2)
Export a Wolfram Language expression exactly as it appears on the screen. First, generate some expression as an output cell:
Adjust the window width of the current notebook in order to obtain the wrapping you wish. Then obtain the current wrappingWidth of the output cell, and export the expression as Pane with ImageSize→wrappingWidth:
Properties and Relations (4)
Define a region using Annotation:
CellBoundingRectangle returns the bounding rectangle for the cell as it currently appears on the screen:
Rasterize[expr,"Regions"] also returns the bounding rectangle for the region defined by Annotation, taking fixed values for some Notebook and Cell options, including PageWidth and Magnification:
By setting these options explicitly, we can partially reproduce the result of Rasterize with CellBoundingRectangle: