Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Blob image memory stream
Versions des environnements
Network:
Windows 2003 Server
Hey all, I'm working with a VFP app and I'm trying to display an image from an image field in sql server 2000. I'm trying to do the same thing I'm doing in a c# app. This is the code in c#. Basically I dont want to create the file, I know I can do that in VFP but I'd rather stream from memory. If anyone has had any experience with this some help would be great.
In c#:
FileStream fs = new FileStream(textBox8.Text.Trim(), FileMode.Open);
byte[] image = new Byte[fs.Length];
fs.Read(image, 0, Convert.ToInt32(fs.Length.ToString(), 10) - 1);
fs.Close();
ApplyImage(image);
private void ApplyImage(byte[] image)
{
MemoryStream imageStream = new MemoryStream(image);
pictureBox1.Image = Image.FromStream(imageStream);
}
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement