my problem is that the images that i have to alter are 900mb+. Using the simple Bitmap class is not working because the images are quite apparently too large to fit into memory that way. (throwing an OutOfMemory exception)
I want to step over the part of loading the image, and turn it into streaming the pixels from the image straight from the disk. I kind of have an idea of how to get the stream open and start reading, but I have no idea what to do with the 32bit integers that are being returned.
Anyone have any ideas or tutorials on how to stream pixel data from an image??
thnx
Dim oldImage As Bitmap
Try
oldImage = New Bitmap(file)
Catch ex As Exception
MsgBox("Image is too large! " + ex.Message.ToString(), MsgBoxStyle.Critical)
Return
End Try
Dim newImage As Bitmap = New Bitmap(100, 100)
' 2:06 to run currently
' Copy all the appropriate pixels from the old image into the new scene
While x < 100And y < 100
newImage.SetPixel(x, y, oldImage.GetPixel(x + offsetX, y + offsetY))
If x = 99 Then
x = 0
y += 1
Else
x += 1
End If
End While

New Topic/Question
Reply




MultiQuote





|