ColtSeavers
Member
- Joined
- Aug 18, 2019
- Messages
- 8
- Programming Experience
- Beginner
Hi,
i converted a bmp into a byte Array with a memorystream.
No proplems, working fine.
But when i'm displaying the Datas in the a datagridview there are some strange zero-values!
Here is an image:
In the attachment yo will find my little project.
Hope you can help me!
Best regards;
ColtSeavers
i converted a bmp into a byte Array with a memorystream.
No proplems, working fine.
But when i'm displaying the Datas in the a datagridview there are some strange zero-values!
Here is an image:
VB.NET:
Option Strict On
Imports System.IO
Public Class Form1
Private Sub CmdEinlesen_Click(sender As Object, e As EventArgs) Handles CmdEinlesen.Click
Dim Bild As Image = Image.FromFile("D:\PROGRAMMIERUNG\VISUAL_STUDIO\VISUAL_BASIC\DATA_GRID_VIEW\Dgv_Bmp_2DimArray\TestMap.bmp")
Dim bitmapBytes As Byte()
Using stream As New System.IO.MemoryStream
Bild.Save(stream, Bild.RawFormat)
bitmapBytes = stream.ToArray
End Using
Dim bytes2(250, 250) As Byte
Dim zeilen As Integer = 0
Dim spalten As Integer = 0
Dim index As Integer = 54
Dim triplet As String = Nothing
For i As Integer = 54 To bitmapBytes.Length - 1
DgvDaten.Rows.Add({bitmapBytes(i)})
Next
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For spalte As Integer = 0 To 23
DgvDaten.Columns.Add("Spalte" & (spalte + 1), "Spalte" & (spalte + 1))
Next
End Sub
End Class
In the attachment yo will find my little project.
Hope you can help me!
Best regards;
ColtSeavers