?? 如何無失真地縮放和保存圖象.txt
字號:
你 可 以 使 用 PictureClip控 件 來 放 置 圖 像 。 下 面 的 范 例 可 以 將 PictureClip對 象 上 的 圖 像 縮 放 拷 貝 到 PictureBox對 象 并 實 現 無 失 真 的 保 存 。
Dim SaveMode As Integer
' Save the current ScaleMode for the picture box.
SaveMode = Picture1.ScaleMode
' Get X and Y coordinates of the clipping region.
PicClip1.ClipX = 0 'Val(Text1.Text)
PicClip1.ClipY = 0 'Val(Text2.Text)
' Set the area of the clipping region (in pixels).
PicClip1.ClipHeight = PicClip1.Height
PicClip1.ClipWidth = PicClip1.Width
' Set the picture box ScaleMode to pixels.
Picture1.ScaleMode = 3
' Set the destination area to fill the picture box.
PicClip1.StretchX = Picture1.ScaleWidth
PicClip1.StretchY = Picture1.ScaleHeight
' Assign the clipped bitmap to the picture box.
Picture1.Picture = PicClip1.Clip
' Reset the ScaleMode of the picture box.
Picture1.ScaleMode = SaveMode
'SavePicture PicClip1.Picture, "c:\b.jpg"
Picture1.Picture.Render Picture1.hDC, 0, 0, 20, 20, 10, 10, 20, 20, ByVal 0
SavePicture Picture1, "c:\a.bmp"
其 中 PicClip1是 PictureClip對 象 , 而 Picture1是 Picture對 象 。
http://member.netease.com/~blackcat
<END>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -