タイトル : 縮小画像の保存 投稿日 : 2009/07/26(Sun) 17:28 投稿者 : bin
縮小画像の保存についてお教えください。 下記のコーディングで画像は縮小表示できたのですが、 表示しないで、縮小画像を保存したいのです。 下記で'画像を縮小表示以下のところをどのように修正すれば よいのかお教えください。 Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '補間方法を指定して画像を縮小して表示する 'Bitmapオブジェクトの作成 Dim image = New Bitmap("D:\写真他\テスト画像\jpg\Water lilies.jpg") 'PictureBox1のGraphicsオブジェクトの作成 Dim g As Graphics = PictureBox1.CreateGraphics() '補間方法として最近傍補間を指定する g.InterpolationMode = _ System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor '画像を縮小表示 g.DrawImage(image, 0, 0, 150, 120) 'BitmapとGraphicsオブジェクトを破棄 image.Dispose() g.Dispose() End Sub End Class |