16,552
社区成员
发帖
与我相关
我的任务
分享
Public Class Form1
Dim bgimage As Bitmap
Dim bggriphic As Graphics
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
bgimage = New Bitmap(Application.StartupPath & "\01.jpg")
bggriphic = Graphics.FromImage(bgimage)
Me.BackgroundImage = bgimage
Dim DestRect, ScrRect As Rectangle
'目标矩形区域
DestRect.X = 100
DestRect.Height = 100
DestRect.Width = 100
'源标矩形区域
ScrRect.Height = 100
ScrRect.Width = 100
'本行语句失效
bggriphic.DrawImage(Me.BackgroundImage, DestRect, ScrRect, GraphicsUnit.Pixel)
End Sub
End Class