Forum: VB.NET |
Thema:
Bild aus Picturebox in String |
Von:
G. Guest (
21.04.2005 11:48) |
Hallo,
wie muß ich den Code ändern, um das Bild nicht aus einer Datei, sondern aus der PictureBox1 auszulesen ? Das soll mit einem Memorystream gehen.
Dim fs As New IO.FileStream("bild.gif", IO.FileMode.Open, IO.FileAccess.Read)
Dim buff(fs.Length - 1) As Byte
fs.Read(buff, 0, buff.Length)
fs.Close()
Dim bildalsbase64 As String = Convert.ToBase64String(buff)
MsgBox(bildalsbase64)
MsgBox(bildalsbase64.Length)
buff = Convert.FromBase64String(bildalsbase64)
Dim b As Bitmap = New Bitmap(New MemoryStream(buff))
PictureBox1.Image = b
Betreff |
Von |
Datum |
|
  |
Re: Bild aus Picturebox in String
Hallo Guest,<br><br>über die Image Methode:<br>public void Save(<br> Stream stream,<br> ImageFormat format<br>);<br>kannst Du das Image in einen Stream (Memory) umwandeln, den Stream kannst Du anschließend über... |
 |
 |
 |
|
|
Ansgar
Sommer
|
21.04.2005 15:54 |
|
|
Gunnar
Krause
|
22.04.2005 09:47 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!