vb.net在窗体控件中显示一个有文字有图片的文档

2024-11-28 00:57:07
推荐回答(1个)
回答(1):

给你一示例吧!原理是一样的!
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
g.FillRectangle(Brushes.White, Me.ClientRectangle)
Dim gp As New GraphicsPath
gp.AddString("Beautiful", New FontFamily("Times New Roman"), (FontStyle.Bold Or FontStyle.Italic), 100, New Point(5, 5), StringFormat.GenericTypographic)
g.SetClip(gp)
g.DrawImage(New Bitmap("background.jpg"), Me.ClientRectangle)
gp.Dispose()
End Sub