replace
クラス: mlreportgen.ppt.PicturePlaceholder
名前空間: mlreportgen.ppt
画像プレースホルダーから画像への置換
説明
は、指定された画像プレースホルダーを指定された画像に置き換え、画像オブジェクトを返します。replacementPictureObj
= replace(picturePlaceholder
,picture
)
例
画像プレースホルダーから画像への置換
Title and Picture
スライドをプレゼンテーションに追加し、タイトルと画像プレースホルダーを独自のタイトルと画像に置き換えます。
PPT API クラスに長い完全修飾名を使用せずに済むよう、PPT 名前空間をインポートします。
import mlreportgen.ppt.*
プレゼンテーションを作成します。
ppt = Presentation("myPicturePlaceholderPresentation.pptx");
open(ppt);
Title and Picture
レイアウトのスライドを追加します。
slide = add(ppt,"Title and Picture");
スライド オブジェクトの find
メソッドを使用して、Title
という名前のプレースホルダー オブジェクトを見つけます。
titlePlaceholderObj = find(slide,"Title")
titlePlaceholderObj = TextBoxPlaceholder with properties: Bold: [] Font: [] ComplexScriptFont: [] FontColor: [] FontSize: [] Italic: [] Strike: [] Subscript: [] Superscript: [] Underline: [] BackgroundColor: [] VAlign: [] Name: 'Title' X: [] Y: [] Width: [] Height: [] Style: [] Children: [] Parent: [1×1 mlreportgen.ppt.Slide] Tag: 'ppt.TextBoxPlaceholder:30:125' Id: '30:125'
find
メソッドは、mlreportgen.ppt.TextBoxPlaceholder
オブジェクトを返します。
プレースホルダーのコンテンツをタイトル テキストに置き換えます。
replace(titlePlaceholderObj,"Airplane");
スライド オブジェクトの find
メソッドを使用して、Picture
という名前のプレースホルダー オブジェクトを見つけます。
picturePlaceholderObj = find(slide,"Picture")
picturePlaceholderObj = PicturePlaceholder with properties: Bold: [] Font: [] ComplexScriptFont: [] FontColor: [] FontSize: [] Italic: [] Strike: [] Subscript: [] Superscript: [] Underline: [] BackgroundColor: [] VAlign: [] Name: 'Picture' X: [] Y: [] Width: [] Height: [] Style: [] Children: [] Parent: [1×1 mlreportgen.ppt.Slide] Tag: 'ppt.PicturePlaceholder:31:126' Id: '31:126'
find
メソッドは、mlreportgen.ppt.PicturePlaceholder
オブジェクトを返します。
画像プレースホルダーを画像に置き換えます。
replace(picturePlaceholderObj,Picture("b747.jpg"));
プレゼンテーションを閉じて表示します。
close(ppt); rptview(ppt);
PowerPoint® は画像の寸法を調整して、画像プレースホルダーに合わせます。画像プレースホルダーの寸法が Picture
オブジェクトの寸法より大きい場合、画像はそれに比例して引き伸ばされます。寸法が小さい場合、画像は中央に配置されます。
入力引数
picturePlaceholder
— 画像プレースホルダー
mlreportgen.ppt.PicturePlaceholder
オブジェクト
画像プレースホルダー。mlreportgen.ppt.PicturePlaceholder
オブジェクトとして指定します。
picture
— 置換項目として使用する画像
mlreportgen.ppt.Picture
オブジェクト
画像プレースホルダーの置換項目として使用する画像。mlreportgen.ppt.Picture
オブジェクトとして指定します。
出力引数
replacementPictureObj
— 置き換えられた画像
mlreportgen.ppt.Picture
オブジェクト
置き換えられた画像。mlreportgen.ppt.Picture
オブジェクトとして返されます。
バージョン履歴
R2015b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)