メインコンテンツまでスキップ

Show.Image

Show.Image は Presentation モジュール(Office.show(iframe))のオブジェクト型です。メソッド 69 個。

備考​

メソッド​

メソッド説明
align(alignType)図形をスライド基準で配置します。
flip(direction)図形を上下または左右に反転します。
getCrop()画像に適用されたトリミング(crop)の状態を返します。
getEffects()図形に適用された効果を返します。
getFill()図形の塗りつぶしを返します。
getHeight()図形の高さを返します。
getHyperlink()図形に設定されたハイパーリンクを返します。
getLineCap()線の先端の形状(cap)を返します。
getLineColor()線の色を返します。
getLineDash()線の破線の種類を返します。
getLineJoin()線の結合の種類(join)を返します。
getLineStyle()線のスタイルを返します。
getLineWidth()線の太さ(pt)を返します。
getPlaceholderType()図形の placeholder の種類を返します。
getPresetId()図形の OOXML preset id(prst)を返します。
getRotation()図形の回転角度を返します。
getTransform()図形の位置、サイズ、回転の情報を返します。
getWidth()図形の幅を返します。
getX()図形の X 座標を返します。
getY()図形の Y 座標を返します。
getZOrderIndex()親(スライド、グループの子であればそのグループ)内での図形の z-order 順位を返します。
hasText()図形がテキストを含んでいるかどうかを返します。
isChart()Checks whether this handle is of type Chart (type guard for narrowing the union).
isControl()Checks whether this handle is of type Control (type guard for narrowing the union).
isDiagram()Checks whether this handle is of type Diagram (type guard for narrowing the union).
isFlippedH()図形が左右に反転した状態かどうかを返します。
isFlippedV()図形が上下に反転した状態かどうかを返します。
isGroup()Checks whether this handle is of type Group (type guard for narrowing the union).
isImage()Checks whether this handle is of type Image (type guard for narrowing the union).
isLine()Checks whether this handle is of type Line (type guard for narrowing the union).
isOleObject()Checks whether this handle is of type OleObject (type guard for narrowing the union).
isPlaceholder()図形が placeholder(タイトル · 本文の枠など)かどうかを返します。
isShape()Checks whether this handle is of type Shape (type guard for narrowing the union).
isTable()Checks whether this handle is of type Table (type guard for narrowing the union).
moveBy(distance)図形を現在の位置を基準に x、y だけ相対移動します。
remove3d()図形の 3D 効果を削除します。
removeEffect(effectType)効果を削除します。
removeFill()塗りつぶしを削除します(noFill)。
removeHyperlink()図形のハイパーリンクを削除します。
removeLineColor()線の色を削除します(noFill)。
reorder(order)図形の重なり順(前面へ/背面へ)を変更します。
resetSize()画像をドキュメントに格納された元のサイズに戻します。
set3d(scene3d, sp3d)図形に 3D 効果を適用します。
setCrop(crop)画像を指定した方向にトリミングします。
setEffects(effects)getEffects() が返した効果オブジェクトをそのまま適用します。
setFill(fill)getFill() が返した塗りつぶしオブジェクトをそのまま適用します。
setGlow(glow)光彩効果を適用します。
setGradientFill(type, stops, angle)グラデーションの塗りつぶしを設定します。
setHeight(height)図形の高さを設定します。
setHyperlink(hyperlink)図形にハイパーリンクを設定します。
setImageFill(imageUrl, fillMode, alpha, detail)画像の塗りつぶしを設定します。
setInnerShadow(shadow)内側の影を適用します。
setLineCap(lineCap)線の先端の形状(cap)を設定します。
setLineColor(color, alpha)線の色を設定します。
setLineDash(lineDash)線のスタイル(破線)を設定します。
setLineGradient(type, stops, angle)線(枠線)のグラデーションの塗りつぶしを設定します。
setLineJoin(lineJoin)線の結合の種類(join)を設定します。
setLineStyle(style)getLineStyle() が返した線のスタイルオブジェクトをそのまま適用します。
setLineWidth(lineWidth)線の太さを設定します。
setOuterShadow(shadow)外側の影を適用します。
setPatternFill(preset, foreColor, backColor, foreAlpha, backAlpha)パターン(模様)の塗りつぶしを設定します。
setReflection(reflection)反射効果を適用します。
setRotation(rotation)図形の回転角度を絶対値で設定します。
setSoftEdge(softEdge)ぼかし(softEdge)効果を適用します。
setSolidFill(color, alpha)図形の塗りつぶしを単色に設定します。
setTransform(transform)図形の位置・サイズ・回転を一度に設定します。
setWidth(width)図形の幅を設定します。
setX(x)図形の X 座標を絶対値で設定します。
setY(y)図形の Y 座標を絶対値で設定します。

メソッドの詳細​

align(alignType)​

図形をスライド基準で配置します。移動できない図形の場合は無視されます。グループの子も、グループ内ではなくスライドを基準に移動します。子がグループの外に出ると、グループは子を含むように一緒に広がります。

align(alignType: AlignType): Promise<void>;

パラメーター

名前型説明
alignTypeAlignType配置の種類

戻り値

none

flip(direction)​

図形を上下または左右に反転します。現在の反転状態を切り替えるトグルで、現在反転しているかどうかは isFlippedH()/isFlippedV() で読み取ります。回転できない図形では反転も無視されます。回転した図形は角度も鏡像として一緒に変わります(getRotation() の値が 360 - 元の角度 に変わります)。

flip(direction: FlipDirection): Promise<void>;

パラメーター

名前型説明
directionFlipDirection反転方向

戻り値

none

getCrop()​

画像に適用されたトリミング(crop)の状態を返します。(setCrop と対称 - 返されたオブジェクトをそのまま渡せます)すべての値の単位はパーセントです(-100~100)。トリミングしていない方向は 0 で、負の値は外側の余白です。

getCrop(): Promise<ImageCrop | null>;

戻り値

Promise<ImageCrop | null> - トリミングの状態。対象の画像がない場合は null

getEffects()​

図形に適用された効果を返します。適用された効果のみがキーとして含まれます。各値は対応する setter(setOuterShadow/setInnerShadow/setGlow/setSoftEdge/setReflection/set3d)の引数と同じ形式です。影・光彩の alpha は不透明(0)でも常に含まれ、長さ(pt)・比率(%)は小数第 1 位に丸められます。outerShadow・innerShadow が両方格納されたドキュメントの場合は両方を含みます(setter では 1 つしか設定できません)。

getEffects(): Promise<Effects | null>;

戻り値

Promise<Effects | null> - 効果の情報。適用された効果がない場合は空のオブジェクト \{\}、対象の図形がない場合(共同編集中の削除など)は null

getFill()​

図形の塗りつぶしを返します。(setFill と対称 - 返されたオブジェクトをそのまま渡せます)type ごとの個別の setter は setSolidFill/setGradientFill/setImageFill/setPatternFill/removeFill です。

getFill(): Promise<Fill | null>;

戻り値

Promise<Fill | null> - 塗りつぶしの情報。noFill の場合は \{ type: FillType.NONE \}、対象の図形がない場合(共同編集中の削除など)は null

getHeight()​

図形の高さを返します。(setHeight と対称)

getHeight(): Promise<number | null>;

戻り値

Promise<number | null> - 高さ(px 単位)。対象の図形がない場合は null

図形に設定されたハイパーリンクを返します。返されたオブジェクトはそのまま setHyperlink に渡せます。ただし、Web アドレスの検査を通過しない url リンクは例外です。サポートされていない種類(プログラムの実行・マクロなど)が設定されている場合は null です。クリック時に動作するハイパーリンクのみを読み取ります - setHyperlink/removeHyperlink と対象は同じです(マウスを重ねたときに動作するリンクは対象外です)。文字(run)単位で設定されたテキストリンクは Shape.getTextHyperlink で読み取ります。

getHyperlink(): Promise<Hyperlink | null>;

戻り値

Promise<Hyperlink | null> - ハイパーリンク情報。ハイパーリンクがない場合は null

getLineCap()​

線の先端の形状(cap)を返します。(setLineCap と対称)

getLineCap(): Promise<LineCap | null>;

戻り値

Promise<LineCap | null> - 線の先端の形状。設定がない場合は既定値 LineCap.FLAT、対象の図形がない場合は null

getLineColor()​

線の色を返します。(setLineColor と対称。透明度も必要な場合は getLineStyle を使用)

getLineColor(): Promise<string | null>;

戻り値

Promise<string | null> - 線の色(hex "#RRGGBB" - scheme color も hex に変換されて返されます)。単色の線でない場合(線なし・グラデーション・パターンなど)、または対象の図形がない場合は null

getLineDash()​

線の破線の種類を返します。(setLineDash と対称)

getLineDash(): Promise<LineDash | null>;

戻り値

Promise<LineDash | null> - 線の破線の種類。LineDash enum でない場合、または対象の図形がない場合は null

getLineJoin()​

線の結合の種類(join)を返します。(setLineJoin と対称)

getLineJoin(): Promise<LineJoin | null>;

戻り値

Promise<LineJoin | null> - 線の結合(角)の種類。設定がない場合は既定値 LineJoin.ROUND、対象の図形がない場合は null

getLineStyle()​

線のスタイルを返します。(setLineStyle と対称 - 返されたオブジェクトをそのまま渡せます)個別の setter は setLineColor/setLineGradient/setLineWidth/setLineDash/setLineCap/setLineJoin です。線の塗りつぶしは getFill と同じ形式で格納します。

getLineStyle(): Promise<LineStyle | null>;

戻り値

Promise<LineStyle | null> - 線のスタイル。対象の図形がない場合は null

getLineWidth()​

線の太さ(pt)を返します。(setLineWidth と対称)

getLineWidth(): Promise<number | null>;

戻り値

Promise<number | null> - 線の太さ(pt)。線なし(noFill)でも太さはそのまま返します。対象の図形がない場合は null

getPlaceholderType()​

図形の placeholder の種類を返します。

getPlaceholderType(): Promise<PlaceholderType | null>;

戻り値

Promise<PlaceholderType | null> - placeholder の種類。placeholder でない場合、または対象の図形がない場合は null

getPresetId()​

図形の OOXML preset id(prst)を返します。

getPresetId(): Promise<string | null>;

戻り値

Promise<string | null> - preset id(prst)。ない場合は null

getRotation()​

図形の回転角度を返します。(setRotation と対称)

getRotation(): Promise<number | null>;

戻り値

Promise<number | null> - 回転角度(degree)。対象の図形がない場合は null

getTransform()​

図形の位置、サイズ、回転の情報を返します。x/y は反転(flip)の有無にかかわらず図形の左上なので、戻り値を別の図形の setTransform にそのまま渡すと、2 つの図形が同じ位置に配置されます。値は丸めて返されます - サイズは小数第 1 位、位置は整数です。setter も同じ単位で受け取るため、インポートしたドキュメントのようにより細かく配置された図形は、渡し直すとその分だけ移動します。

getTransform(): Promise<ShapeTransform | null>;

戻り値

Promise<ShapeTransform | null> - 図形の位置・サイズ・回転の情報。対象の図形がない場合(共同編集中の削除など)は null

getWidth()​

図形の幅を返します。(setWidth と対称)

getWidth(): Promise<number | null>;

戻り値

Promise<number | null> - 幅(px 単位)。対象の図形がない場合は null

getX()​

図形の X 座標を返します。(setX と対称)

getX(): Promise<number | null>;

戻り値

Promise<number | null> - X 座標(px 単位)。対象の図形がない場合は null

getY()​

図形の Y 座標を返します。(setY と対称)

getY(): Promise<number | null>;

戻り値

Promise<number | null> - Y 座標(px 単位)。対象の図形がない場合は null

getZOrderIndex()​

親(スライド、グループの子であればそのグループ)内での図形の z-order 順位を返します。0 が最背面で、大きいほど前面です。

getZOrderIndex(): Promise<number | null>;

戻り値

Promise<number | null> - z-order 順位。対象の図形がない場合は null

hasText()​

図形がテキストを含んでいるかどうかを返します。空白のみの場合や空の段落が 2 つ以上ある場合(改行のみを入力した状態)は true、空の段落が 1 つだけの場合は false です。図形レベルのテキストを持たない種類(表・グループ・グラフ)は常に false です。(表はセル単位で照会)

hasText(): Promise<boolean | null>;

戻り値

Promise<boolean | null> - テキストの有無。対象の図形がない場合は null

isChart()​

Checks whether this handle is of type Chart (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isChart(): Promise<this is Chart>;

戻り値

Promise<this is Chart>

isControl()​

Checks whether this handle is of type Control (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isControl(): Promise<this is Control>;

戻り値

Promise<this is Control>

isDiagram()​

Checks whether this handle is of type Diagram (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isDiagram(): Promise<this is Diagram>;

戻り値

Promise<this is Diagram>

isFlippedH()​

図形が左右に反転した状態かどうかを返します。(flip(FlipDirection.HORIZONTAL) を呼び出すとこの値が反転します)

isFlippedH(): Promise<boolean | null>;

戻り値

Promise<boolean | null> - 左右反転の有無。対象の図形がない場合は null

isFlippedV()​

図形が上下に反転した状態かどうかを返します。(flip(FlipDirection.VERTICAL) を呼び出すとこの値が反転します)

isFlippedV(): Promise<boolean | null>;

戻り値

Promise<boolean | null> - 上下反転の有無。対象の図形がない場合は null

isGroup()​

Checks whether this handle is of type Group (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isGroup(): Promise<this is Group>;

戻り値

Promise<this is Group>

isImage()​

Checks whether this handle is of type Image (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isImage(): Promise<this is Image>;

戻り値

Promise<this is Image>

isLine()​

Checks whether this handle is of type Line (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isLine(): Promise<this is Line>;

戻り値

Promise<this is Line>

isOleObject()​

Checks whether this handle is of type OleObject (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isOleObject(): Promise<this is OleObject>;

戻り値

Promise<this is OleObject>

isPlaceholder()​

図形が placeholder(タイトル · 本文の枠など)かどうかを返します。

isPlaceholder(): Promise<boolean | null>;

戻り値

Promise<boolean | null> - placeholder かどうか。対象の図形がない場合は null

isShape()​

Checks whether this handle is of type Shape (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isShape(): Promise<this is Shape>;

戻り値

Promise<this is Shape>

isTable()​

Checks whether this handle is of type Table (type guard for narrowing the union). Checks the SDK handle's internal discriminator synchronously - no postMessage round trip, no await needed.

isTable(): Promise<this is Table>;

戻り値

Promise<this is Table>

moveBy(distance)​

図形を現在の位置を基準に x、y だけ相対移動します。(絶対座標の設定は setX / setY)

moveBy(distance: ShapeMoveDistance): Promise<void>;

パラメーター

名前型説明
distanceShapeMoveDistance移動量(px 単位)

戻り値

none

remove3d()​

図形の 3D 効果を削除します。

remove3d(): Promise<void>;

戻り値

none

removeEffect(effectType)​

効果を削除します。その効果が設定されていない場合は何もしません。図形が直接持つ効果のみを削除します - 図形のスタイルから継承した効果は削除対象ではないため、getEffects() の結果に含まれていても削除されない場合があります。

removeEffect(effectType: EffectType): Promise<void>;

パラメーター

名前型説明
effectTypeEffectType削除する効果の種類

戻り値

none

removeFill()​

塗りつぶしを削除します(noFill)。

removeFill(): Promise<void>;

戻り値

none

図形のハイパーリンクを削除します。文字(run)単位のテキストリンクは Shape.removeTextHyperlink で削除します。

removeHyperlink(): Promise<void>;

戻り値

none

removeLineColor()​

線の色を削除します(noFill)。

removeLineColor(): Promise<void>;

戻り値

none

reorder(order)​

図形の重なり順(前面へ/背面へ)を変更します。すでに目標の位置にあり変更がない場合は無視されます。

reorder(order: ShapeZOrder): Promise<void>;

パラメーター

名前型説明
orderShapeZOrder順序変更の種類

戻り値

none

resetSize()​

画像をドキュメントに格納された元のサイズに戻します。トリミング(crop)がある場合は一緒に削除します。

resetSize(): Promise<void>;

戻り値

none

set3d(scene3d, sp3d)​

図形に 3D 効果を適用します。scene3d と sp3d のうち値がある方のみを適用し、両方を省略すると何も変更しません。

set3d(scene3d?: Scene3d, sp3d?: Sp3d): Promise<void>;

パラメーター

名前型説明
scene3d(省略可)Scene3dカメラ(回転)の設定。省略するか空のオブジェクトの場合は適用しません
sp3d(省略可)Sp3d底面からの距離の設定。省略するか空のオブジェクトの場合は適用しません

戻り値

none

setCrop(crop)​

画像を指定した方向にトリミングします。(getCrop と対称 - 返されたオブジェクトをそのまま渡せます)指定した方向のみを適用し、省略した方向は既存の値を維持します。トリミングをなくすには 0 を明示します。すべての値の単位はパーセントです(-100~100)。正の値はその方向を切り取り、負の値は外側の余白を作ります。マージ結果が現在の値と同じ場合は何もしません。

setCrop(crop: Partial<ImageCrop>): Promise<void>;

パラメーター

名前型説明
cropPartial<ImageCrop>トリミングの設定

戻り値

none

setEffects(effects)​

getEffects() が返した効果オブジェクトをそのまま適用します。(getEffects と対称 - 図形→図形の効果のコピー)含まれている効果のキーのみを対応する setter で適用します。scene3d/sp3d は set3d にまとめて渡します。対象の既存の効果は消去しません - 完全にコピーするには removeEffect/remove3d で先に削除してから適用します。outerShadow と innerShadow を一緒に渡しても拒否せず、outerShadow → innerShadow の順に適用するため、常に innerShadow が残ります。

setEffects(effects?: Effects): Promise<void>;

パラメーター

名前型説明
effects(省略可)EffectsgetEffects() の戻り値。省略すると何も変更しません

戻り値

none

setFill(fill)​

getFill() が返した塗りつぶしオブジェクトをそのまま適用します。(getFill と対称 - 図形→図形の塗りつぶしのコピー)image は照会結果の embed を再利用するため、同じドキュメント内でのみ復元されます。embed のない image は適用する画像がないため無視されます(新しい画像は setImageFill)。

setFill(fill?: Fill): Promise<void>;

パラメーター

名前型説明
fill(省略可)FillgetFill() の戻り値。省略すると何も変更しません

戻り値

none

setGlow(glow)​

光彩効果を適用します。(getEffects().glow と対称 - 返されたオブジェクトをそのまま渡せます)省略したフィールドは既定値で補います(フィールドごとの既定値は Glow を参照)。

setGlow(glow?: Glow): Promise<void>;

パラメーター

名前型説明
glow(省略可)Glow光彩の設定

戻り値

none

setGradientFill(type, stops, angle)​

グラデーションの塗りつぶしを設定します。

setGradientFill(type?: GradientType, stops?: GradientStop[], angle?: number): Promise<void>;

パラメーター

名前型説明
type(省略可)GradientTypeグラデーションの種類(lin/circle/rect/shape)(既定値: GradientType.LINEAR)
stops(省略可)GradientStop[]色の変化点(既定値: [{ color: "accent1", pos: 0 }, { color: "bg1", pos: 100 }])
angle(省略可)numberグラデーションの角度(lin の場合のみ使用)(既定値: 45)

戻り値

none

setHeight(height)​

図形の高さを設定します。サイズを変更できない図形の場合は無視されます。

setHeight(height: number): Promise<void>;

パラメーター

名前型説明
heightnumber高さ(px 単位、小数第 1 位に丸め)

戻り値

none

図形にハイパーリンクを設定します。(getHyperlink と対称 - 返されたオブジェクトをそのまま渡してハイパーリンクをコピーできます。ただし、Web アドレスの検査を通過しない url リンクは例外です)url リンクのアドレスが空でない場合、http:// または https:// で始まらないアドレスの先頭に http:// を付け、その結果が Web アドレスである必要があります。空の url アドレス、サポートされていない種類、無効な対象(削除されたスライドなど)は無視されます。文字(run)単位のテキストリンクは Shape.setTextHyperlink で設定します。

setHyperlink(hyperlink: Hyperlink | null): Promise<void>;

パラメーター

名前型説明
hyperlinkHyperlink | nullハイパーリンク情報。null の場合はハイパーリンクを削除します(removeHyperlink と同じ動作)。type がない場合は無視します

戻り値

none

setImageFill(imageUrl, fillMode, alpha, detail)​

画像の塗りつぶしを設定します。

setImageFill(
imageUrl: string,
fillMode?: ImageFillMode,
alpha?: number,
detail?: ImageFillDetail
): Promise<void>;

パラメーター

名前型説明
imageUrlstring画像 URL
fillMode(省略可)ImageFillMode画像の塗りつぶし方法(既定値: ImageFillMode.STRETCH)
alpha(省略可)number透明度(0~100、0=不透明)(既定値: 0)
detail(省略可)ImageFillDetail詳細オプション。offset/scale/mirror/align は fillMode=ImageFillMode.TILE の場合のみ反映(既定値: {})

戻り値

none - 画像のアップロード後、塗りつぶしの適用が完了すると resolve されます。

setInnerShadow(shadow)​

内側の影を適用します。(getEffects().innerShadow と対称
返されたオブジェクトをそのまま渡せます)省略したフィールドは既定値で補います(フィールドごとの既定値は InnerShadow を参照)。図形が持てる影は 1 つです
外側の影が設定されている場合は内側の影に置き換わります。

setInnerShadow(shadow?: InnerShadow): Promise<void>;

パラメーター

名前型説明
shadow(省略可)InnerShadow影の設定

戻り値

none

setLineCap(lineCap)​

線の先端の形状(cap)を設定します。

setLineCap(lineCap: LineCap): Promise<void>;

パラメーター

名前型説明
lineCapLineCap線の先端の形状

戻り値

none

setLineColor(color, alpha)​

線の色を設定します。

setLineColor(color: string | SchemeColor, alpha?: number): Promise<void>;

パラメーター

名前型説明
colorstring | SchemeColorhex(#RRGGBB)または SchemeColor
alpha(省略可)number透明度(0~100、0=不透明)。小数第 3 位まで保存されます(既定値: unchanged)

戻り値

none

setLineDash(lineDash)​

線のスタイル(破線)を設定します。

setLineDash(lineDash: LineDash): Promise<void>;

パラメーター

名前型説明
lineDashLineDash線の破線のスタイル

戻り値

none

setLineGradient(type, stops, angle)​

線(枠線)のグラデーションの塗りつぶしを設定します。

setLineGradient(type?: GradientType, stops?: GradientStop[], angle?: number): Promise<void>;

パラメーター

名前型説明
type(省略可)GradientTypeグラデーションの種類(lin/circle/rect/shape)(既定値: GradientType.LINEAR)
stops(省略可)GradientStop[]色の変化点(既定値: [{ color: "accent1", pos: 0 }, { color: "bg1", pos: 100 }])
angle(省略可)numberグラデーションの角度(lin の場合のみ使用)(既定値: 45)

戻り値

none

setLineJoin(lineJoin)​

線の結合の種類(join)を設定します。

setLineJoin(lineJoin: LineJoin): Promise<void>;

パラメーター

名前型説明
lineJoinLineJoin線の結合(角)の種類

戻り値

none

setLineStyle(style)​

getLineStyle() が返した線のスタイルオブジェクトをそのまま適用します。(getLineStyle と対称 - 図形→図形の線のコピー)

setLineStyle(style?: LineStyle): Promise<void>;

パラメーター

名前型説明
style(省略可)LineStylegetLineStyle() の戻り値。省略すると何も変更しません

戻り値

none

setLineWidth(lineWidth)​

線の太さを設定します。

setLineWidth(lineWidth: number): Promise<void>;

パラメーター

名前型説明
lineWidthnumber線の太さ(pt 単位)

戻り値

none

setOuterShadow(shadow)​

外側の影を適用します。(getEffects().outerShadow と対称
返されたオブジェクトをそのまま渡せます)省略したフィールドは既定値で補います(フィールドごとの既定値は OuterShadow を参照)。図形が持てる影は 1 つです
内側の影が設定されている場合は外側の影に置き換わります。

setOuterShadow(shadow?: OuterShadow): Promise<void>;

パラメーター

名前型説明
shadow(省略可)OuterShadow影の設定

戻り値

none

setPatternFill(preset, foreColor, backColor, foreAlpha, backAlpha)​

パターン(模様)の塗りつぶしを設定します。(getFill と往復で対称)

setPatternFill(
preset: PatternPreset,
foreColor?: string | SchemeColor,
backColor?: string | SchemeColor,
foreAlpha?: number,
backAlpha?: number
): Promise<void>;

パラメーター

名前型説明
presetPatternPreset模様のプリセット
foreColor(省略可)string | SchemeColor前景色 hex(#RRGGBB)または SchemeColor(既定値: SchemeColor.ACCENT1)
backColor(省略可)string | SchemeColor背景色 hex(#RRGGBB)または SchemeColor(既定値: SchemeColor.BG1)
foreAlpha(省略可)number前景色の透明度(0~100、0=不透明)(既定値: 0)
backAlpha(省略可)number背景色の透明度(0~100、0=不透明)(既定値: 0)

戻り値

none

setReflection(reflection)​

反射効果を適用します。(getEffects().reflection と対称 - 返されたオブジェクトをそのまま渡せます)省略したフィールドは既定値で補います(フィールドごとの既定値は Reflection を参照)。

setReflection(reflection?: Reflection): Promise<void>;

パラメーター

名前型説明
reflection(省略可)Reflection反射の設定

戻り値

none

setRotation(rotation)​

図形の回転角度を絶対値で設定します。回転できない図形の場合は無視されます。(getRotation と対称)

setRotation(rotation: number): Promise<void>;

パラメーター

名前型説明
rotationnumber回転角度(degree)

戻り値

none

setSoftEdge(softEdge)​

ぼかし(softEdge)効果を適用します。(getEffects().softEdge と対称 - 返されたオブジェクトをそのまま渡せます)省略したフィールドは既定値で補います(フィールドごとの既定値は SoftEdge を参照)。

setSoftEdge(softEdge?: SoftEdge): Promise<void>;

パラメーター

名前型説明
softEdge(省略可)SoftEdgeぼかしの設定

戻り値

none

setSolidFill(color, alpha)​

図形の塗りつぶしを単色に設定します。

setSolidFill(color: string | SchemeColor, alpha?: number): Promise<void>;

パラメーター

名前型説明
colorstring | SchemeColorhex(#RRGGBB)または SchemeColor
alpha(省略可)number透明度(0~100、0=不透明)。小数第 3 位まで保存されます(既定値: unchanged)

戻り値

none

setTransform(transform)​

図形の位置・サイズ・回転を一度に設定します。getTransform() の戻り値をそのまま渡せます。(getTransform と対称)値を指定したフィールドのみをサイズ→位置→回転の順に適用し、省略したフィールドは現在の値を維持します。各フィールドは個別の setter と同様に、その操作(サイズ変更/移動/回転)ができない図形では無視されます。

setTransform(transform?: Partial<ShapeTransform>): Promise<void>;

パラメーター

名前型説明
transform(省略可)Partial<ShapeTransform>位置/サイズ(px)· 回転(degree)。省略すると何も変更しません

戻り値

none

setWidth(width)​

図形の幅を設定します。サイズを変更できない図形の場合は無視されます。

setWidth(width: number): Promise<void>;

パラメーター

名前型説明
widthnumber幅(px 単位、小数第 1 位に丸め)

戻り値

none

setX(x)​

図形の X 座標を絶対値で設定します。移動できない図形の場合は無視されます。(相対移動は moveBy)

setX(x: number): Promise<void>;

パラメーター

名前型説明
xnumberX 座標(px 単位、整数に丸め)

戻り値

none

setY(y)​

図形の Y 座標を絶対値で設定します。移動できない図形の場合は無視されます。

setY(y: number): Promise<void>;

パラメーター

名前型説明
ynumberY 座標(px 単位、整数に丸め)

戻り値

none