Aucune réponse
OCRz.GetText
Dim strNew as String ="" Dim str As String = "monde tous salut" Dim strarr() As String strarr = str.Split(" "c) For i=1 to strarr.length -1 step -1 strNew=strNew & " " & strarr[i] Next RichTextBox1.Text = strNew
For i As Integer = strarr.Length - 1 To 0 Step -1
mais j'aimerai que le 1er mot reste tel qu'il est ...
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim strNew As String = "" Dim str As String = "monde tous salut" Dim strarr() As String strarr = str.Split(" ") For i = strarr.Length - 1 To 0 Step -1 strNew = strNew & " " & strarr(i) Next Me.TextBox1.Text = strNew End Sub
strarr(i)
For i = strarr.Length - 1 To 0 Step -1
Imports Emgu.CV 'Imports Emgu.CV.Util Imports Emgu.CV.OCR Imports Emgu.Util Imports Emgu.CV.Structure Public Class Form1 Dim OCRa As Tesseract = New Tesseract("tessdata", "ara", Tesseract.OcrEngineMode.OEM_CUBE_ONLY) 'OEM_TESSERACT_ONLY) 'OEM_TESSERACT_ONLY, // Run Tesseract only - fastest 'OEM_CUBE_ONLY, // Run Cube only - better accuracy, but slower 'OEM_TESSERACT_CUBE_COMBINED, // Run both and combine results - best accuracy 'OEM_DEFAULT // Specify this mode when calling init_*(), ' // to indicate that any of the above modes ' // should be automatically inferred from the ' // variables in the language-specific config, ' // command-line configs, or if not specified ' // in any of the above should be set to the ' // default OEM_TESSERACT_ONLY. Dim OCRf As Tesseract = New Tesseract("tessdata", "fra", Tesseract.OcrEngineMode.OEM_TESSERACT_ONLY) Dim OCRg As Tesseract = New Tesseract("tessdata", "eng", Tesseract.OcrEngineMode.OEM_TESSERACT_ONLY) Dim pic As Bitmap = New Bitmap(697, 206) Dim gfx As Graphics = Graphics.FromImage(pic) Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'If Windows XP gfx.CopyFromScreen(New Point(Me.Location.X + PictureBox1.Location.X + 4, Me.Location.Y + PictureBox1.Location.Y + 30), New Point(0, 0), pic.Size) PictureBox1.Image = pic 'If Windows 7 'gfx.CopyFromScreen(MousePosition, New Point(0, 0), pic.Size) End Sub ' Pour l'arabe : ' ============= Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click OCRa.Recognize(New Image(Of Bgr, Byte)(pic)) Me.RichTextBox1.RightToLeft = System.Windows.Forms.RightToLeft.Yes RichTextBox1.SelectedText = RightToLeft.Yes RichTextBox1.SelectionAlignment = HorizontalAlignment.Right RichTextBox1.Font = New Font("Traditional Arabic", 14) RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont, FontStyle.Bold) RichTextBox1.Text = OCRa.GetText() 'RichTextBox1.Text = RichTextBox1.Rtf 'RichTextBox.SpellCheck.IsEnabled = True Dim strNew As String = "" Dim str As String = OCRa.GetText().ToString Dim strarr() As String strarr = str.Split(" ") 'strarr = str.Split(New Char() {" "c}) For i As Integer = 1 To strarr.Length - 1 Step -2 strNew = strNew & " " & strarr(i) Next 'For Each word As String In strarr 'strNew = strNew & " " & word 'Next RichTextBox1.Text = strNew RichTextBox1.SaveFile(CurDir() & "Fichier.Rtf") 'MsgBox(CurDir() & "Fichier.Rtf") 'For i As Integer = Len(RichTextBox1.Text) To 0 Step -1 'RichTextBox1.Text = RichTextBox1.Text & Microsoft.VisualBasic.Right(RichTextBox1.Text.ToString, i) 'Next 'RichTextBox1.Text = StrReverse(RichTextBox1.Text) End Sub ' Pour le français : ' ================ Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click OCRf.Recognize(New Image(Of Bgr, Byte)(pic)) Me.RichTextBox1.RightToLeft = System.Windows.Forms.RightToLeft.No RichTextBox1.Text = OCRf.GetText End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click OCRg.Recognize(New Image(Of Bgr, Byte)(pic)) Me.RichTextBox1.RightToLeft = System.Windows.Forms.RightToLeft.No RichTextBox1.Text = OCRg.GetText End Sub ' Pour l'Anglais : ' ============== Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub ' Bouton Apropos : ' ============== Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click MsgBox("هذا البرنامج من إعداد بلحسن عبد القادر من الجزائر - سعيدة - " & vbCrLf & vbCrLf _ & vbCrLf & "Email: kadiro.bel20@yahoo.fr " & vbCrLf, MsgBoxStyle.Information + MsgBoxStyle.MsgBoxRtlReading, "حول البرنامج") End Sub End Class