[]
IBackgroundPicture, IShapeThis interface defines the common position and size members for floating objects such as shapes, charts, and pictures. It provides coordinates and dimensions in worksheet units through methods such as getTop(), getLeft(), getWidth(), and getHeight(), and also provides pixel-based variants for the same measurements.
Objects that implement IContainer are typically obtained from drawing APIs that return related interfaces such as IShape.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setTop(40);
container.setLeft(50);
double width = container.getWidth();
doubledoubledoublegetLeft()doubledoublegetTop()doubledoublegetWidth()doublevoidsetHeight(double value) voidsetHeightInPixel(double value) voidsetLeft(double value) voidsetLeftInPixel(double value) voidsetTop(double value) voidsetTopInPixel(double value) voidsetWidth(double value) voidsetWidthInPixel(double value)
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double top = container.getTop();
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setTop(100.0);
value - The distance from the top edge of the object to the top edge of the worksheet.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double left = container.getLeft();
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setLeft(100.0);
value - The distance from the left edge of the object to the left edge of column A(on a worksheet) or the left edge of the chart area (on a chart).This value is measured in worksheet units. Use getWidthInPixel() to retrieve the width in pixels.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double width = container.getWidth();
This value is measured in worksheet units. Use getWidthInPixel() to retrieve the width in pixels.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setWidth(100.0);
value - The width of the object.This value is measured in worksheet units. Use getHeightInPixel() to retrieve the height in pixels.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double height = container.getHeight();
This value is measured in worksheet units. Use getHeightInPixel() to retrieve the height in pixels.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setHeight(100.0);
value - The height of the object.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double top = container.getTopInPixel();
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setTopInPixel(100.0);
value - The distance (in pixels) from the top edge of the object to the top edge of the worksheet.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double left = container.getLeftInPixel();
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setLeftInPixel(100.0);
value - The distance, in pixels, from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).Use this method to retrieve the pixel-based width of a floating object such as a shape, chart, or picture.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double width = container.getWidthInPixel();
Use this method to set the pixel-based width of a floating object such as a shape, chart, or picture.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setWidthInPixel(100.0);
value - The width of the object, in pixels.Use this method to retrieve the pixel-based height of a floating object such as a shape, chart, or picture.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
double height = container.getHeightInPixel();
Use this method to set the pixel-based height of a floating object such as a shape, chart, or picture.
IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
container.setHeightInPixel(100.0);
value - The height of the object, in pixels.