Oppure

Loading
30/05/08 3:42
buongiorno a tutti...

tempo fa' son riuscito nella mia piccola chat ad introdurre gli smile, sostituendo ad un determinato simbolismo una immagine, ora vorrei fare il contrario cioe' da una immagine recuperare i caratteri letterali,.....
questo e' il codice per gli smile....
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lparam As Any) As Long
Const smile = "bmp1,bmp2,bmp3,bmp4,bmp5,bmp6,bmp7,bmp8,bmp9,bmpbig1,bmpbig2,bmpbig3"
Private Const WM_PASTE = &H302

Private Function emoticons()
 Dim Placement As Integer
 Dim Start As Integer
  'Clipboard.Clear
  tmp = Split(smile, ",")
  For I = 0 To UBound(tmp)
    If InStr(1, txtmotta.Text, tmp(I)) Then
        Placement = InStr(txtmotta.Text, tmp(I))
        Start = Placement + 1
        txtmotta.SelStart = Placement - 1
        txtmotta.SelLength = Len(tmp(I))
        txtmotta.SelText = ""
        temp = Clipboard.GetText
        Clipboard.SetData LoadPicture(App.Path & "\smile\" & tmp(I) & ".bmp")
        txtmotta.Locked = False
        SendMessage txtmotta.hwnd, WM_PASTE, 0, 0
        txtmotta.Locked = True
        Clipboard.SetText temp
        Clipboard.Clear
    End If
  Next
End Function

Private Sub Timer1_Timer()
 emoticons
End Sub


come posso fare il processo inverso?...cioe' se ina richtextbox ho le immagini riuscirle a sostituire con le lettere?.....

Ultima modifica effettuata da 30/05/08 3:43