次の方法で共有


サムネイル画像の作成

サムネイル画像は、画像の小さなバージョンです。 サムネイル画像を作成するには、Image オブジェクトの GetThumbnailImage メソッドを呼び出します。

次の例では、ファイル Compass.bmpから Image オブジェクトを作成します。 元の画像の幅は 640 ピクセル、高さは 479 ピクセルです。 このコードでは、幅が 100 ピクセル、高さが 100 ピクセルのサムネイル画像が作成されます。

Image image(L"Compass.bmp");
Image* pThumbnail = image.GetThumbnailImage(100, 100, NULL, NULL);
graphics.DrawImage(pThumbnail, 10, 10, 
   pThumbnail->GetWidth(), pThumbnail->GetHeight());

次の図は、サムネイル画像を示しています。

コンパス図