Freigeben über


Word.ShapeScaleFrom enum

Gibt an, welcher Teil der Form beim Skalieren die Position beibehält.

Hinweise

[ API-Satz: WordApiDesktop 1.2 ]

Beispiele

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/45-shapes/group-ungroup.yaml

await Word.run(async (context) => {
  // Scales the first set of grouped shapes (including text boxes) found in the document body.
  const firstShapeGroup: Word.Shape = context.document.body.shapes
    .getByTypes([Word.ShapeType.group])
    .getFirstOrNullObject();
  firstShapeGroup.load("shapeGroup/shapes");
  await context.sync();

  if (firstShapeGroup.isNullObject) {
    console.log("No shape groups found in the document body.");
    return;
  }

  let shapeGroup: Word.ShapeGroup = firstShapeGroup.shapeGroup;
  console.log("About to scale the first shape group found in the document body:", shapeGroup.shapes);
  firstShapeGroup.scaleHeight(0.75, Word.ShapeScaleType.currentSize);
  firstShapeGroup.scaleWidth(0.5, Word.ShapeScaleType.currentSize, Word.ShapeScaleFrom.scaleFromBottomRight);

  console.log("Scaled the first shape group.");
});

Felder

scaleFromBottomRight = "ScaleFromBottomRight"

Skalieren Sie von der unteren rechten Ecke der Form aus.

scaleFromMiddle = "ScaleFromMiddle"

Skalieren Sie von der Mitte der Form aus.

scaleFromTopLeft = "ScaleFromTopLeft"

Skalieren Sie von der linken oberen Ecke der Form aus.