IRONSOFTWAREHOME

PowerPointで画像を管理する方法

Ahmad Sohail
Ahmad Sohail
Updated: 2026年6月29日

マルチメディア要素は、PowerPointプレゼンテーションの不可欠な構成要素です。 特に画像は、視覚的なコンテキストを提供し、各スライドで提示される情報を補強します。プロフェッショナルで拡張性のあるプレゼンテーションを維持するためには、効果的な画像管理(新しいビジュアルの挿入、既存のビジュアルの更新、古くなったグラフィックの整理など)が不可欠です。

このガイドはIronPPTを使ってプログラムで画像を扱う方法を示します。


画像の追加

IronPPTを使ってPowerPointドキュメントに画像を追加するには、新しいドキュメントオブジェクトを作成してください(あるいは既存のファイルから読み込んでください)。 次に、ファイルを参照するImageクラスから画像オブジェクトを作成します。画像が読み込まれたら、ドキュメントに追加し、表示するスライド番号を指定します。 そこから、Angleなどのプロパティを使用して画像属性を変更できます。 最後に、新しく画像を追加したドキュメントをエクスポートします。

using IronPPT;
using IronPPT.Models;

// Create a new presentation document
var document = new PresentationDocument();

// Create and load an image from file
Image image = new Image();
image.LoadFromFile("image.jpg");

// Add image to the first slide (index 0)
var newImage = document.AddImage(image, 0);

// Rotate the image 180 degrees
newImage.Angle = 180;

// Save the presentation as a PPTX file
document.Save("adding-image.pptx");
PowerPointスライドに画像を追加する

画像プロパティ

以下の表で、イメージプロパティのオプションをご覧ください。

プロパティ翻訳内容翻訳例
高さ画像の高さをポイントで設定します。image.Height = 300;.
画像の幅をポイントで設定します。image.Width = 400;.
角度画像を指定した角度だけ回転させます。image.Angle = 45;.
ポジションx座標とy座標を使用して、スライド上の画像の位置を設定します。image.Position = (200, 200);.
フレームシェイプShapeType列挙値を使用して、画像のフレーム形状を設定します。image.FrameShape = IronPPT.Enums.ShapeType.RoundRectangle;.

追加された画像のプロパティを変更する

スライドに画像を追加した後、そのプロパティを変更して、外観や位置を調整することができます。 例えば、Angleなどのプロパティを使用して、画像のサイズや回転をカスタマイズします。 これらの設定を調整することで、プレゼンテーション内の画像の表示方法を微調整することができます。

using IronPPT;
using IronPPT.Models;
using IronPPT.Enums;

// Load an existing presentation document
var document = new PresentationDocument("existing-presentation.pptx");

// Create and load an image from file
Image image = new Image();
image.LoadFromFile("image.jpg");

// Add image to the second slide (index 1)
var newImage = document.AddImage(image, 1);

// Modify image properties
newImage.Angle = 45; // Rotate the image 45 degrees
newImage.FrameShape = ShapeType.RoundRectangle; // Set the frame shape to Rounded Rectangle
newImage.Position = (180, 180); // Set the position to coordinates (180, 180)
newImage.Width = 300; // Set the width to 300 points
newImage.Height = 300; // Set the height to 300 points

// Save the modified presentation as a new PPTX file
document.Save("modifying-image-properties.pptx");
PowerPointで画像のプロパティを変更する

画像を置き換える

IronPPTで画像を置き換えるのは直感的な作業です。 まず、プレゼンテーション文書と新しい画像を新しいImageオブジェクトに読み込みます。 次に、更新したい画像をターゲットにし、そのスライドとインデックスを選択します。例えば、Slides[0].Images[0](最初のスライドの最初の画像の場合)です。 完了したら、新しい画像オブジェクトを使用してReplaceメソッドを呼び出し、ファイルをエクスポートします。

using IronPPT;
using IronPPT.Models;

// Load an existing presentation
var document = new PresentationDocument("sample.pptx");

// Load the replacement image
Image replaceImage = new Image();
replaceImage.LoadFromFile("sample.png");

// Replace the first image found in the first slide
document.Slides[0].Images[0].Replace(replaceImage);

// Save changes (overwriting the original file)
document.Save("sample.pptx");

原文

PowerPoint スライド上の画像を置き換える (置き換え前)

結果

PowerPoint スライド上の画像を置き換える (置き換え後)

インデックスで画像を削除

画像を削除する最も簡単な方法は、インデックスの位置です。 スライドの画像コレクションにアクセスし、削除したい画像のゼロベースのインデックスを使用してRemoveメソッドを使用します。 このアプローチは、コレクション内の画像の正確な位置がわかっている場合に効果的です。

using IronPPT;

// Load an existing presentation
var document = new PresentationDocument("real_sample.pptx");

// Remove the first image found on the second slide
document.Slides[1].Images[0].Remove();

// Save the updated presentation
document.Save("removed-image.pptx");
C#

画像除去前

PowerPoint スライドからインデックスで画像を削除する (表示前)

画像の除去後

PowerPoint スライドからインデックスで画像を削除する (表示後)

すべての画像の削除

ドキュメント内のすべてのforループを使用できます。まずすべてのドキュメントページを反復処理し、続いてページごとに識別された画像を削除するために再度反復処理します。 以下に例を示します。

using IronPPT;
using IronPPT.Models;

// Load an existing presentation
var document = new PresentationDocument("real_sample.pptx");

// Remove all images from every slide
for (int s = 0; s < document.Slides.Count; s++)       // Loop through all slides
{
    var slide = document.Slides[s];                   // Get the current slide

    for (int i = slide.Images.Count - 1; i >= 0; i--) // Loop backward through images on this slide
    {
        slide.Images[i].Remove();                     // Remove each image
    }
}

// Save the updated presentation
document.Save("removed-images.pptx");

一括削除の前に

PowerPoint スライドからインデックスを使用して画像を一括削除する (表示前)

一括削除の後

ご覧のように、スライド2と4からすべての画像が削除されています。

PowerPoint スライドからインデックスを使用して画像を一括削除する (表示後)

よくある質問

PowerPointプレゼンテーションに画像を追加する場合、どのような画像ファイル形式を使用できますか。

IronPPTはJPEG, PNG, BMP, GIF, TIFFを含む一般的な画像フォーマットをサポートしています。このライブラリはプレゼンテーションに画像を追加する際にフォーマット変換と最適化を自動的に行い、ほとんどの画像ソースとの互換性を保証します。

プレゼンテーションの特定のスライドに画像を追加するにはどうすればよいですか?

IronPPTを使って画像を追加するには、まずImage.Create()で画像ファイルのパスを指定して画像オブジェクトを作成し、slide.Images.Add()で特定のスライドに追加します。例えば、ppt.Slides[0].Images.Add(image)は最初のスライドに画像を追加します。

プログラムで画像のサイズや寸法を制御できますか?

はい、IronPPTではImageオブジェクトのWidthとHeightプロパティを使って画像の寸法を設定することができます。画像をスライドに追加する前か後に、image.Width = 400、image.Height = 300のように、これらのプロパティにポイント値を割り当てるだけです。

スライド上の特定の位置に画像を配置するにはどうすればよいですか?

IronPPTはPositionプロパティでx,y座標を使って正確な画像位置決めを可能にします。座標系は左上隅(0,0)から始まり、値はポイントで、スライド表面のどこにでも画像を配置することができます。

PowerPointプレゼンテーションの既存の画像を置き換えることは可能ですか?

はい、IronPPTはプレゼンテーションの既存の画像の置き換えをサポートしています。置き換える画像を特定し、同じ位置とプロパティを維持しながら新しい画像オブジェクトで置き換えることができます。

プログラムでスライドから画像を削除できますか?

IronPPTはプレゼンテーションから個別に、あるいは一括して画像を削除する機能を提供します。スライドのImagesコレクションにアクセスし、適切な削除方法を使用することで、特定の画像を削除することができます。

Why should I manage images in a PowerPoint presentation programmatically?

Managing images programmatically with IronPPT enhances efficiency, ensures precision in positioning and sizing, and allows for dynamic updates, essential for professional and scalable presentations.

What is the 'Image' class used for in IronPPT?

In IronPPT, the `Image` class is used to create image objects that you can load from files and manipulate by setting different properties before adding them to PowerPoint slides.

Can I export a modified PowerPoint with new images using IronPPT?

Yes, once you've made modifications or additions of images in a PowerPoint, you can export the presentation as a PPTX file using IronPPT, preserving all your adjustments.

What are some common image properties that can be adjusted using IronPPT?

Common image properties include `Height`, `Width`, `Angle`, `Position`, and `FrameShape`, allowing for comprehensive customization of image appearance and placement on slides.

Ahmad Sohail
フルスタックデベロッパー

Ahmadは、C#、Python、およびウェブ技術に強い基盤を持つフルスタック開発者です。彼はスケーラブルなソフトウェアソリューションの構築に深い関心を持ち、デザインと機能が実際のアプリケーションでどのように融合するかを探求することを楽しんでいます。

...
詳しく読む

準備はできましたか?

Nuget Downloads 6,070バージョン:2026.9リリースされたばかり

PDF用C# NuGetライブラリ
NuGetでインストール

バージョン: 2026.9

PM > Install-Package IronPPT
nuget.org/packages/IronPPT/
  1. ソリューションエクスプローラーで参照を右クリックし、NuGetパッケージを管理を選択
  2. 「参照」を選択して「IronPPT」を検索します
  3. パッケージを選択してインストール
C# PDF DLL
DLLをダウンロード

バージョン: 2026.9

  1. IronPPTをダウンロードして、ソリューションディレクトリ内の~/Libsなどの場所に解凍します
  2. Visual Studioソリューションエクスプローラーで、参照を右クリックします。「IronPPT.dll」を参照して選択します

ライセンスは$999から

Key in blue circle

無料の30日間トライアルキーをすぐに入手してください。

Your trial license will be sent to your email address

制限なし。100% ロック解除済み。クレジットカード不要。

bullet_checkedクレジットカードやアカウントの作成は不要です。制限なし。100% ロック解除済み。クレジットカード不要。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
無料のライブデモを予約する
Booking Badge

世界中の数百万人のエンジニアから信頼されています。

ライセンスはより安く
義務のない相談を受ける
下記のフォームを記入するか、sales@ironsoftware.comにメールしてください。
あなたの詳細は常に守秘されます。
世界中の数百万人のエンジニアから信頼されています。
ライセンスはより安く
あなたの無料30日間の試用キーをすぐに入手。
クレジットカードやアカウントの作成は不要です。