|
-
Sep 23rd, 2022, 10:22 AM
#1
Thread Starter
New Member
Problem Writing to Multi-Line Textbox and Streamwriter at Same Time
Hello,
I'm scanning a JPG image file pixel by pixel and writing the results to a streamwriter (output.txt)...This part works perfectly.
I'm now trying to list the same information to a multi-line textbox (textbox1) but it only lists the last line once it completes.
I want all of the lines to list in the textbox and scroll as it scans the JPG file.
Here's my Code:
Private Sub Pixel_Button_Click(sender As System.Object, e As System.EventArgs) Handles Pixel_Button.Click
Dim PixelImage As New Bitmap(Picture1.Image, Picture1.Width, Picture1.Height)
Dim Writer As New System.IO.StreamWriter("C:\Users\Scott\Downloads\output.txt")
For i As Integer = 0 To PixelImage.Width - 1
For j As Integer = 0 To PixelImage.Height - 1
Dim pixel As Color = PixelImage.GetPixel(i, j)
Writer.WriteLine("Coordinates: " & j & "," & i & " - " & pixel.ToString)
TextBox1.Text = "Coordinates: " & j & "," & i & " - " & pixel.ToString
Next j
Next i
Writer.Close()
MessageBox.Show("Pixel Scan Completed!")
End Sub
I appreciate any help I can get.
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|