。net 不用api就行
創(chuàng)新互聯(lián)擁有一支富有激情的企業(yè)網(wǎng)站制作團(tuán)隊(duì),在互聯(lián)網(wǎng)網(wǎng)站建設(shè)行業(yè)深耕十年,專業(yè)且經(jīng)驗(yàn)豐富。十年網(wǎng)站優(yōu)化營(yíng)銷經(jīng)驗(yàn),我們已為成百上千家中小企業(yè)提供了成都網(wǎng)站建設(shè)、成都做網(wǎng)站解決方案,按需求定制制作,設(shè)計(jì)滿意,售后服務(wù)無憂。所有客戶皆提供一年免費(fèi)網(wǎng)站維護(hù)!
縮放操作
Function 縮放(ByVal bitmap As Bitmap, ByVal 倍數(shù) As Single) As Bitmap
Dim w As Integer = bitmap.Width * 倍數(shù)
Dim h As Integer = bitmap.Height * 倍數(shù)
Dim tem As New Bitmap(w, h)
Dim g As Graphics = Graphics.FromImage(tem)
g.DrawImage(bitmap, New Rectangle(0, 0, w, h), New Rectangle(0, 0, bitmap.Width, bitmap.Height), GraphicsUnit.Pixel)
g.Dispose()
Return tem
End Function
鼠標(biāo)滾輪事件 MouseWheel
MouseEventArgs.Delta 值可以判斷滾動(dòng)方向
Pegasus的ImagXpress 8.0控件,支持各種格式文件的加載??丶庋b了右鍵局部區(qū)域放大的功能,要實(shí)現(xiàn)圖片的縮放,把AutoResize屬性設(shè)置為PegasusImaging.WinForms.ImagXpress8.AutoResizeType.CropImage,修改 ZoomFactor的值就可以了。
Sub 圖片縮放()
Dim SngPer As Single = 1 '放大或縮小的比例 放大2倍時(shí)SngPer=2,縮小3倍時(shí) SngPer=1/3
Dim PicOld As Image = Image.FromFile("原圖片路徑")
Dim PicNew As New System.Drawing.Bitmap(PicOld, PicOld.Width * SngPer, PicOld.Height * SngPer)
PicNew.Save("新圖片路徑", Drawing.Imaging.ImageFormat.Jpeg)
End Sub