G
Guest
I want to clear all of the byes that are associated with a BitmapData object.
I know that one technique would be to do the following:
'...
Dim bitmapData As Drawing.Imaging.BitmapData = myBitmap.LockBits(rect,
flags, format)
'...
Dim arrayLength As Integer = (bitmapData.Stride * bitmapData.Height)
Dim emptyByteArray(arrayLength - 1) As Byte
System.Runtime.InteropServices.Marshal.Copy(emptyByteArray, 0,
bitmapData.Scan0, emptyByteArray.Length)
The problem is that creating emptyByteArray can require a significant amount
of time and memory when working with large images. Is there a technique that
would not require the creation of emptyByteArray?
Thanks,
Lance
I know that one technique would be to do the following:
'...
Dim bitmapData As Drawing.Imaging.BitmapData = myBitmap.LockBits(rect,
flags, format)
'...
Dim arrayLength As Integer = (bitmapData.Stride * bitmapData.Height)
Dim emptyByteArray(arrayLength - 1) As Byte
System.Runtime.InteropServices.Marshal.Copy(emptyByteArray, 0,
bitmapData.Scan0, emptyByteArray.Length)
The problem is that creating emptyByteArray can require a significant amount
of time and memory when working with large images. Is there a technique that
would not require the creation of emptyByteArray?
Thanks,
Lance