strange problem (streams and bitmaps)
I load a bitmap, put it into an array of bytes...i alter some values (in this case i put al the values starting from 13879 to 50000 on zero(black)).
_______Dim i As Integer
_______Dim mfs As FileStream
_______mfs = New FileStream("WW" & 1 & ".bmp", FileMode.Open)
_______Dim myarray(CInt(mfs.Length) - 1) As Byte
_______Dim mms As New MemoryStream()
_______mfs.Read(myarray, 0, mfs.Length)
_______mfs.Close()
_______For i = 13879 To 50000 Step 1
___________myarray(i) = 0
_______Next
I write my array to a memorystream cause that way i can put it into the picture box
_______mms.Write(myarray, 0, myarray.Length)
_______pBox.Image = System.Drawing.Bitmap.FromStream(mms)
Now here is the problem. When i draw the pbox, all elements behind 13879 are set to zero. When i put watches on it then the mms(memorystream) and array are filled up correctly even after drawing the pbox. What's wrong with it?? It should only draw black till 50000.
I used setpixel, put it is way to slow so that's not a noption anymore.
ty...
Khumbu