Selection Methoden innerhalb einer RichTextBox

  • Sonstige

    Selection Methoden innerhalb einer RichTextBox

    Hallo Zusammen !
    Ich habe folgendes Problem:
    Ich habe vor, die Pixel eines Bildes einzulesen und in farbigen Text wiederzugeben.
    Bisher bin ich allerdings nur soweit, dass der gesamte Text in Farbe des ersten Pixels [1;1] gefärbt wird:

    Visual Basic-Quellcode

    1. For h As Integer = 1 To pbImage.Image.Height
    2. For w As Integer = 1 To pbImage.Image.Width
    3. Dim b As Bitmap = pbImage.Image
    4. Dim c As New Color
    5. c = b.GetPixel(w - 1, h - 1)
    6. tbOut.Text = tbOut.Text + "##"
    7. tbOut.SelectionStart = tbOut.TextLength - 2
    8. tbOut.SelectionLength = 2
    9. tbOut.SelectionColor = c
    10. tbOut.SelectionStart = tbOut.TextLength
    11. tbOut.Update()
    12. ProgressBar1.Value = h
    13. Text = w.ToString + ":" + h.ToString + " " + c.ToString
    14. Next
    15. tbOut.Text = tbOut.Text + vbCrLf
    16. Next


    Kann mir da jemand sagen, was ich falsch mache ?