Public Function Displayimage(image As Integer(,)) As Bitmap Dim i As Integer, j As Integer Dim output As New Bitmap(image.GetLength(0), image.GetLength(1)) Dim bitmapData1 As BitmapData = output.LockBits(New Rectangle(0, 0, image.GetLength(0), image.GetLength(1)), ImageLockMode.[ReadOnly], PixelFormat.Format32bppArgb) Dim imagePointer1 As Pointer(Of Byte) = CType(bitmapData1.Scan0, Pointer(Of Byte)) For i = 0 To bitmapData1.Height - 1 For j = 0 To bitmapData1.Width - 1 imagePointer1(0) = CByte(image(j, i)) imagePointer1(1) = CByte(image(j, i)) imagePointer1(2) = CByte(image(j, i)) imagePointer1(3) = 255 '4 bytes per pixel imagePointer1 += 4 Next 'end for j '4 bytes per pixel imagePointer1 += (bitmapData1.Stride - (bitmapData1.Width * 4)) 'end for i Next 'end unsafe output.UnlockBits(bitmapData1) Return output ' col; End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)