Parsi Coders

نسخه‌ی کامل: VB6 Writing text to a picture box
شما در حال مشاهده نسخه آرشیو هستید. برای مشاهده نسخه کامل کلیک کنید.
با سورس زیر میتونید داخل یه عکس متن مورد نظر خودتون رو بنویسید.
کد:
Option Explicit
Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hDC As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Private Const DT_WORDBREAK = &H10
Public By: Parsicoders.com

'usage
Dim rct As RECT





Private Sub Command1_Click()
DrawText Picture1.hDC, Text1.Text, -1, rct, DT_WORDBREAK
End Sub

Private Sub Form_Load()

Picture1.ScaleMode = vbPixels
With rct
    .Left = 0
    .Right = Picture1.ScaleWidth
    .Top = 0
    .Bottom = Picture1.ScaleHeight
End With

End Sub