當前位置:首頁 » 圖片效果 » vb圖片怎樣顯示字元
擴展閱讀
怎樣曬雞皮果好吃 2024-06-20 15:45:19
怎樣讓頭發變一個顏色 2024-06-20 15:39:06

vb圖片怎樣顯示字元

發布時間: 2024-05-27 19:01:28

Ⅰ 奼傚ぇ紲炴寚鐐箆b.net PictureBox1 涓婇潰鎬庝箞鏄劇ず鏂囧瓧鍛 瑕佹渶灝忓寲鍦ㄨ繕鍘熶篃涓嶄細鍙樼殑閭g

VB.NET鍦≒icTureBox鎺т歡閲屾樉紺烘枃鏈錛屼技涔庡苟涓嶇畝鍗曪紝璇曡瘯榪欐典唬鐮侊紝鑷宸辯悽紓ㄤ竴涓嬶細
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim format1 As New StringFormat(StringFormatFlags.NoClip) '灝佽呮枃鏈甯冨矓淇℃伅錛堝傚歸綈銆佹枃瀛楁柟鍚戝拰 Tab 鍋滈潬浣嶏級
format1.LineAlignment = StringAlignment.Center '鍨傜洿灞呬腑
format1.Alignment = StringAlignment.Center '姘村鉤灞呬腑

Dim MyFont As New Font("瀹嬩綋", 12, FontStyle.Regular)
Dim displayRectangle As New Rectangle() '瀛樺偍涓緇勬暣鏁幫紝鍏卞洓涓錛岃〃紺轟竴涓鐭╁艦鐨勪綅緗鍜屽ぇ灝

displayRectangle = New Rectangle(New Point(20, 20), New Size(200, 100))
e.Graphics.DrawString("嬈㈣繋浣跨敤VB Net", MyFont, Brushes.Black, RectangleF.op_Implicit(displayRectangle), format1) '鏄劇ず鍗曞厓鏍奸噷鐨勬枃鏈

End Sub