GDI+ 提供了用來處理點陣影像的 Bitmap 類別,以及用來處理向量影像的 Metafile 類別。BitmapMetafile 類別都繼承自 Image 類別。

點陣圖是由圖形影像的像素資料及其屬性所組成。有許多標準的格式可將點陣圖儲存為檔案。GDI+ 支援下列檔案格式:BMP、GIF、EXIG、JPG、PNG 及 TIFF。如需支援格式的詳細資訊,請參閱 點陣圖類型

Bitmap 類別

封裝 GDI+ 點陣圖,這個點陣圖是由圖形影像的像素資料及其屬性所組成。Bitmap 是用來處理像素資料所定義影像的物件。

●  Dim myBitmap As New Bitmap (width, height)

範例:建立 Bitmap 物件並在其中描繪,然後在現有的 Windows Form PictureBox 控制項中顯示該物件。

Dim bmpImg As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim g As Graphics = Graphics.FromImage(bmpImg)
.....
...... (對 g 進行繪圖動作)
......
PictureBox1.Image = bmpImg

 

 

● Save 方法

Bitmap.Save("FileName")

arrow
arrow
    全站熱搜

    tsuozoe 發表在 痞客邦 留言(0) 人氣()