Bitmap では、C1Bitmap クラスの Load メソッドを使用して、C1Bitmap オブジェクト内に画像を読み込むことができます。Load および LoadAsync のオーバーロードメソッドを使用すると、画像を StorageFile、IInputStream、または System.IO.Stream から読み込むことができます。Bitmap では、画像のサイズ、解像度(DPI)、またはピクセル形式を決定するために使用できる画像メタデータを読み込むこともできます。さらに、いくつかの画像を C1Bitmap の同じインスタンスに1つずつ読み込みまたはインポートすることができます。
読み込みと同様に、C1Bitmap の画像は、StorageFile、IOutputStream、あるいは System.IO.Stream に保存することができます。ビットマップは、コンテナ形式を引数として受け入れる C1Bitmap クラスの一般的な Save メソッドを提供します。また、サポートされている各コンテナ形式に対して個別の SaveAs メソッドを提供します。
ここでは、ファイルから任意の画像を読み込む方法について説明します。ストリームから画像を読み込む方法については「クイックスタート」を参照してください。
以下の手順は、ファイルから任意の画像を読み込む方法を示しています。 このコードは、LoadAsync メソッドを使用して StorageFile から画像を読み込みます。